Results 1 to 6 of 6

Thread: 11.04 Static IP address ignored until networking restart

  1. #1
    Join Date
    Oct 2008
    Location
    Gainesville, Florida
    Beans
    48
    Distro
    Kubuntu 20.04 Focal Fossa

    11.04 Static IP address ignored until networking restart

    I've set up static IP addresses in Kubuntu 9.04 on a couple different machines in the past and in Kubuntu 12.04 on another machine just this evening, and while I've encountered challenges in those installations, I've found solutions . . . until now. I'm trying to set up a laptop running Kubuntu 11.04 with a static IP address and I'm running into a problem for which I've been unable, so far, to find a solution.

    I've added the following lines to /etc/networking/interfaces:
    Code:
    auto wlan0
    iface wlan0 inet static
    address 192.168.0.40
    netmask 255.255.255.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    I've also added two nameservers to the /etc/resolv.conf file, and write-protected the file with
    Code:
    chattr +i /etc/resolv.conf
    When I reboot the machine, ifconfig tells me that wlan0 is set to the IP address 192.168.0.140 (up in the dhcp region). But as soon as I run
    Code:
    /etc/init.d/networking restart
    without having made any changes in any file whatsoever, then ifconig tells me that wlan0 is using the IP address I want it to: 192.168.0.40.

    I'm using wicd as the network manager, and I've removed the network-manager package that came with 11.04 by default.

    Any idea why the IP address assignment in /etc/network/interfaces is being ignored on boot-up?

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

    Re: 11.04 Static IP address ignored until networking restart

    Any idea why the IP address assignment in /etc/network/interfaces is being ignored on boot-up?
    Yes. It's probably because:
    I'm using wicd as the network manager
    If you want a static address, why is Wicd even installed?

    Moreover, your interfaces file doesn't declare what network you want to connect to nor any encryption details. I strongly suspect the system can't connect and defaults to Wicd. I'd remove Wicd altogether and revise your interfaces file:
    Code:
    auto lo
    iface lo inet loopback
    
    auto wlan0
    iface wlan0 inet static
    address 192.168.0.40
    netmask 255.255.255.0
    gateway 192.168.0.1
    wpa-ssid mylilrouter
    wpa-psk mysecretkey
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

  3. #3
    Join Date
    Oct 2008
    Location
    Gainesville, Florida
    Beans
    48
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: 11.04 Static IP address ignored until networking restart

    Thanks for that. I didn't un-install wicd (I'll still need it when I connect to wireless networks away from home), but I un-checked wicd's "Connect automatically to this network" box. That does enable the desired static IP address in the interfaces file to be used right away.

    However, the computer no longer connects automatically to my network. (No Internet, and no SSH connection from the other machine.) I added the two lines you suggested
    wpa-ssid...
    wpa-psk...
    I wasn't clear whether the variables should be in quotation marks or not and I could find no reference to those lines in the interfaces man-page, so I tried it all three ways -- no quote marks, with single-quotes, and with double-quotes. In the cases of no quotes and double-quotes, I have no network connection until -- once again -- I run
    Code:
    /etc/init.d/networking restart
    When the variables are single-quoted, I get an error message:
    WARNING: plaintext or ascii WPA key has 64 characters,
    it must have between 8 and 63 to be valid.
    My WPA key has, in fact, 62 characters, so I assume that the two single-quote marks are being read as part of the string, causing the restart to fail.

    I seem to have traded one problem (the static IP being ignored) for another (no wireless network connection on boot-up). Is it possible to fix both problems simultaneously?

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

    Re: 11.04 Static IP address ignored until networking restart

    No quotes. Please amend your file and do:
    Code:
    sudo ifdown wlan0 && sudo ifup -v wlan0
    Anything interesting reported?

    I'm not quite sure how you are going to connect automatically and reliably using interfaces but use Wicd at other times. I will install Wicd and have a look.

    EDIT: Did you try to set your static IP in Wicd? Please see attached.
    Attached Images Attached Images
    Last edited by chili555; July 24th, 2012 at 04:55 PM.
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

  5. #5
    Join Date
    Oct 2008
    Location
    Gainesville, Florida
    Beans
    48
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: 11.04 Static IP address ignored until networking restart

    That did it. I set the static IP, Netmask, and Gateway, and the static DNS fields "DNS1" and "DNS2" and I now have network connection on boot-up, using the assigned static IP address. SSH works from the other computer and the Internet connection works.

    Thanks!

    I don't know what to put in the "DNS Domain" or "Search domain" fields, but they don't appear to be necessary. I left them blank and it all seems to work okay.

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

    Re: 11.04 Static IP address ignored until networking restart

    Awesome! Glad it's working.
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.

Tags for this Thread

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
  •