Results 1 to 10 of 18

Thread: ubuntu server wifi not connected after restart, how to connect it?

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Beans
    119

    ubuntu server wifi not connected after restart, how to connect it?

    I did a fresh install of 13.04 and it asked for the ssid and password and was good to go but now after a restart it is not connected
    I tryed looking it up in the ubuntu help place but it was almost mind bombing (probably bc still waking up) it was about setting it up not connecting it pretty much

    in my /etc/network/interfaces
    it has under wlan0
    wpa-ssid asdhgfiaohaiou
    wpa-psk oiahfhioaheoif

    so souldnt there be some simple command to run to connect it?
    and I can put it in a cronjob?

    Thanks,
    Higgins909

  2. #2
    Join Date
    Aug 2006
    Beans
    13,354
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: ubuntu server wifi not connected after restart, how to connect it?

    Just to make sure, do you really use the server edition, as stated in the title, or is it the desktop edition (and you call it Ubuntu server to confuse us )?

  3. #3
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    26,047
    Distro
    Ubuntu Development Release

    Re: ubuntu server wifi not connected after restart, how to connect it?

    in my /etc/network/interfaces
    it has under wlan0
    wpa-ssid asdhgfiaohaiou
    wpa-psk oiahfhioaheoif
    This doen't tell the system how you'd like to connect. Automatically on boot? Or when you issue some command? Or...??

    I suggest you amend /etc/network/interfaces to:
    Code:
    auto lo
    iface lo inet loopback
    
    auto wlan0
    iface wlan0 inet dhcp
    wpa-ssid asdhgfiaohaiou
    wpa-psk oiahfhioaheoif
    Order the system to re-read the file and use the changes:
    Code:
    sudo ifdown wlan0 && sudo ifup wlan0
    Check:
    Code:
    ifconfig
    ping -c3 www.google.com
    When you need to change the server to a static IP so you can ssh and ftp into it easily, post back and we'll help.
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

  4. #4
    Join Date
    Aug 2012
    Beans
    119

    Re: ubuntu server wifi not connected after restart, how to connect it?

    This is my complete /etc/network/interfaces file:


    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    
    #WiFi
    auto wlan0
    iface wlan0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8
    wpa-ssid MOTOROLA-7A908
    wpa-psk  mySETlongPASSWORD
    
    #LAN
    auto eth0
    iface eth0 inet static
    address 192.168.0.99
    netmask 255.255.255.0
    #gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8

    it is ubuntu server 13.04 or 13.??
    I would love to have it connect to wifi on boot and reconnect constantly when wifi goes down
    Im also planing to make a bridge or ICS, wifi connects to my router and shared by lan port to switch to my computers
    it would be nice if I could have both DHCP and static with that, in win7 bridge dosent like DHCP and ICS dont likestatic ip

    Thanks,
    Higgins909
    Last edited by lisati; June 14th, 2013 at 06:11 AM. Reason: Added [code] and [/code] to aid readbility

  5. #5
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    26,047
    Distro
    Ubuntu Development Release

    Re: ubuntu server wifi not connected after restart, how to connect it?

    Let's dig deeper. Do you have a working wireless interface?
    Code:
    iwconfig
    Does it scan and see your network MOTOROLA-7A908?
    Code:
    sudo iwlist wlan0 scan
    Are there any clues as to what happens or doesn't happen when you do:
    Code:
    sudo ifdown wlan0 && sudo ifup -v wlan0
    You have 'auto wlan0' as well as 'auto eth0.' That implies that you want both connected on boot. Is that true and if so, why? I suggest you comment out auto eth0:
    Code:
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    
    #WiFi
    auto wlan0
    iface wlan0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8
    wpa-ssid MOTOROLA-7A908
    wpa-psk mySETlongPASSWORD
    
    #LAN
    #auto eth0
    iface eth0 inet static
    address 192.168.0.99
    netmask 255.255.255.0
    #gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

  6. #6
    Join Date
    Aug 2012
    Beans
    119

    Re: ubuntu server wifi not connected after restart, how to connect it?

    Let's dig deeper. Do you have a working wireless interface?
    Code:
    iwconfig
    Code:
    admin-ben@Langweiler:~$ iwconfig
    eth0      no wireless extensions.
    
    lo        no wireless extensions.
    
    wlan0     IEEE 802.11bgn  ESSID:"MOTOROLA-7A908"
              Mode:Managed  Frequency:2.412 GHz  Access Point: 90:B1:34:44:68:03
              Bit Rate=1 Mb/s   Tx-Power=20 dBm
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Power Management:off
              Link Quality=46/70  Signal level=-64 dBm
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:8   Missed beacon:0
    Does it scan and see your network MOTOROLA-7A908?
    Code:
    sudo iwlist wlan0 scan
    Code:
    admin-ben@Langweiler:~$ sudo iwlist wlan0 scan
    wlan0     Scan completed :
              Cell 01 - Address: 90:B1:34:44:68:03
                        Channel:1
                        Frequency:2.412 GHz (Channel 1)
                        Quality=44/70  Signal level=-66 dBm
                        Encryption key:on
                        ESSID:"MOTOROLA-7A908"
                        Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                        Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                                  36 Mb/s; 48 Mb/s; 54 Mb/s
                        Mode:Master
                        Extra:tsf=000002113f78318f
                        Extra: Last beacon: 300ms ago
                        IE: Unknown: 000E4D4F544F524F4C412D3741393038
                        IE: Unknown: 010482848B96
                        IE: Unknown: 030101
                        IE: Unknown: 2A0104
                        IE: Unknown: 2F0104
                        IE: Unknown: 32080C1218243048606C
                        IE: Unknown: DD09001018020DF0040000
                        IE: WPA Version 1
                            Group Cipher : TKIP
                            Pairwise Ciphers (1) : TKIP
                            Authentication Suites (1) : PSK
                        IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
    
    (Showed a couple more networks)
    Are there any clues as to what happens or doesn't happen when you do:
    Code:
    sudo ifdown wlan0 && sudo ifup -v wlan0
    Code:
    admin-ben@Langweiler:~$ sudo ifdown wlan0 && sudo ifup -v wlan0
    ifdown: interface wlan0 not configured
    Configuring interface wlan0=wlan0 (inet)
    run-parts --verbose /etc/network/if-pre-up.d
    run-parts: executing /etc/network/if-pre-up.d/ethtool
    run-parts: executing /etc/network/if-pre-up.d/wireless-tools
    run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
    wpa_supplicant: terminating wpa_supplicant daemon via pidfile /var/run/wpa_supplicant.wlan0.pid
    Stopped /sbin/wpa_supplicant (pid 2887).
    wpa_supplicant: removing /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
    wpa_supplicant: wpa-driver nl80211,wext (default)
    wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /var/run/wpa_supplicant
    Starting /sbin/wpa_supplicant...
    wpa_supplicant: waiting for "/var/run/wpa_supplicant.wlan0.pid":  0 (max. 5)
    wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
    wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan0
    wpa_supplicant: configuring network block -- 0
    wpa_supplicant: wpa-ssid "MOTOROLA-7A908" -- OK
    wpa_supplicant: wpa-psk ***** -- OK
    wpa_supplicant: enabling network block 0 -- OK
    ip addr add 192.168.0.100/255.255.255.0 broadcast 192.168.0.255           dev wlan0 label wlan0
    RTNETLINK answers: File exists
    Failed to bring up wlan0.
    You have 'auto wlan0' as well as 'auto eth0.' That implies that you want both connected on boot. Is that true and if so, why? I suggest you comment out auto eth0: {It is because I will be bridging or ICS or somthing soon}
    Code:
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    
    #WiFi
    auto wlan0
    iface wlan0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8
    wpa-ssid MOTOROLA-7A908
    wpa-psk mySETlongPASSWORD
    
    #LAN
    #auto eth0
    iface eth0 inet static
    address 192.168.0.99
    netmask 255.255.255.0
    #gateway 192.168.0.1
    dns-nameservers 8.8.4.4, 8.8.8.8
    Thanks,
    Higgins909

  7. #7
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    26,047
    Distro
    Ubuntu Development Release

    Re: ubuntu server wifi not connected after restart, how to connect it?

    RTNETLINK answers: File exists
    Failed to bring up wlan0.
    This suggests that another interface, in this case eth0, is already up and using the gateway, et al. Please try:
    Code:
    sudo ifdown eth0
    sudo ifdown wlan0 && sudo ifup -v wlan0
    ...or reboot. Any improvement?
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

  8. #8
    Join Date
    Aug 2012
    Beans
    119

    Re: ubuntu server wifi not connected after restart, how to connect it?

    I restarted (I changed the #gateway on the lan and gateway on the wifi b4 posting but forgot to restart :/) and did
    Code:
    sudo ifdown wlan0 && sudo ifup -v wlan
    And it works

    Code:
    #WiFi auto wlan0 iface wlan0 inet static address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 8.8.4.4, 8.8.8.8 wpa-ssid MOTOROLA-7A908 wpa-psk mySETlongPASSWORD  #LAN #auto eth0 iface eth0 inet static address 192.168.0.99 netmask 255.255.255.0 #gateway 192.168.0.1 dns-nameservers 8.8.4.4, 8.8.8.8
    B4 Restart

    Code:
    #WiFi auto wlan0 iface wlan0 inet static address 192.168.0.100 netmask 255.255.255.0 #gateway 192.168.0.1 dns-nameservers 8.8.4.4, 8.8.8.8 wpa-ssid MOTOROLA-7A908 wpa-psk mySETlongPASSWORD  #LAN #auto eth0 iface eth0 inet static address 192.168.0.99 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 8.8.4.4, 8.8.8.8
    Now if I could just bridge/ICS (is it possible with just the /etc/network/interfaces file?)

    Thanks,
    Higgins909

  9. #9
    Join Date
    Aug 2012
    Beans
    119

    Re: ubuntu server wifi not connected after restart, how to connect it?

    Nvm dont think it worked, after trying to restart again and then pinged google.com nothing entered

    Code:
    sudo ifdown wlan0 && sudo ifup -v wlan0
    then I was able to ping it at a high 200ms
    myspace.com was like 300ms
    ubuntu.com was 200+
    but could not ping any local addresses, so no ssh :/

  10. #10
    Join Date
    Aug 2012
    Beans
    119

    Re: ubuntu server wifi not connected after restart, how to connect it?

    Code:
    admin-ben@Langweiler:~$ dmesg | grep rt2
    [   28.625743] rt2800pci 0000:02:07.0 wlan0: disabling HT/VHT due to WEP/TKIP use
    [   41.397840] rt2800pci 0000:02:07.0 wlan0: disabling HT/VHT due to WEP/TKIP use
    admin-ben@Langweiler:~$
    I changed my interfaces to
    Code:
    # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).  # The loopback network interface auto lo iface lo inet loopback  # The primary network interface  #WiFi auto wlan0 iface wlan0 inet static address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 wpa-ssid MOTOROLA-7A908 wpa-psk  mySETlongPASSWORD dns-nameservers 8.8.4.4, 8.8.8.8  #LAN auto eth0 iface eth0 inet static address 192.168.0.99 netmask 255.255.255.0 #gateway 192.168.0.1 #dns-nameservers 8.8.4.4, 8.8.8.8#
    and made 2 WiFi.sh files, one to run at startup and one to run every min

    startup
    ifdown eth0
    ifdown wlan0
    ifup wlan0

    everymin
    ifdown wlan0
    ifup wlan0


    atleast i think its set for every min

    currently I have
    ifup eth0
    and its working both interfaces

    now for internet sharing from lanport XD

    Thanks, Been a BIG help!
    Higgins909

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •