UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
All right, I decided to give Kubuntu a try after using Slackware for a couple years. I am using 8.10 with KDE 4 and despite some others here, I have had very little issues with KDE 4. I am crossing my fingers to hope that continues.
My real question is though, is that I am trying to set a static IP on Kubuntu 8.10. I have editted the /etc/network/interfaces and /etc/resolv.conf (which I remember doing similarly in Slackware) to reflect the IP address and DNS servers for which I plan to use. Thought all was fine, but upon restarting the networking services AND even a reboot, it's like the changes I made to the files didn't do any good. It still reverted to an automatically assigned IP OR in some cases no IP at all. So giving up on that, I manually typed in the command for ifconfig and also adding the default gateway. This worked fine and I had internet access again. Now, I thought maybe on a reboot it'd save my changes...again, the answer is no. So...I then figured to create a startup script which I placed in /etc/init.d. Made it executable obviously. But even since doing that, it still won't save the info on reboots. I either have to manually start the script/commands. Any ideas on how I can set this to where it's automatic and it will actually save the settings when I reboot?
Just put your required configuration into /etc/network/interfaces man interfaces for more details
Here's mine, for a static IP:
Code:
auto lo
iface lo inet loopback
# eth0 is wired
iface eth0 inet static
broadcast 10.255.255.255
address 10.0.0.8
netmask 255.255.255.0
# The next address is the address of my router
gateway 10.0.0.2
# These settings are for a small 192.168.0.X network
# with the router at 192.168.0.1
# broadcast 192.168.0.255
# address 192.168.0.8
# netmask 255.255.255.0
# gateway 192.168.0.1
# eth1 is wireless, WPA encrypted
auto eth1
iface eth1 inet static
broadcast 10.0.0.255
address 10.0.0.8
netmask 255.255.255.0
gateway 10.0.0.2
wpa-passphrase NoImNotListingItHere
wpa-ssid MyEssid
wireless-channel 11
Edit the file, then do a sudo /etc/init.d/networking restart
And all should be well.
It should automatically connect at the next boot.
AVOID GUI networking tools, as in my experience, they mess up the interfaces file.
Nice try tredegar...but still no go. That's actually what I had tried before but wasn't able to get it. I, however, didn't have the broadcast line but I added it thinking it might help. But it didn't. My file is basically just like yours with my IP and gateway settings of course, and my resolv.conf is set for the DNS servers I use. I tried the restart of the init.d networking script too a few times...and even rebooted...but it just doesn't want to give my eth0 adapter an IP address even though it is set in those files. The only way I can do it now is manually with the ifconfig eth0 command.
In my experience you also have to disable Network Manager. You can change all the settings for static IPs but when you restart NM will take over again.
Agreed: Disable (= uninstall) the wretched Network "Manager".
Your interfaces file looks good.
Check it still looks good after you have removed Network Manager, then sudo /etc/init.d/networking restart and all should be sweet.
Edit:
If you want a network GUI for wireless get wicd It is good for wireless.
Its repository is here:
Code:
deb http://apt.wicd.net hardy extras
Add that to /etc/apt/sources.list apt-get update
apt-get install wicd
Removed network manager and it STILL won't keep my settings. Even tried the /etc/init.d/networking restart after making the changes and rebooting. When the system reboots or I do the /etc/init.d/networking restart command it still doesn't give eth0 the IP address and settings. It's really weird b/c the system detects my NIC, the files contain the settings I want, but it just can't seem to put the 2 together. Any ideas? Am I missing anything else?
I don't need anything for wireless as my desktop isn't wireless. I'll keep that in mind if I get a decent laptop with wireless though.
I already posted the interfaces file contents in one of my previous posts. As for ifconfig...here's what it shows for eth0 BEFORE I have to manually input the IP address and gateway settings with the ifconfig command.
I already posted the interfaces file contents in one of my previous posts.
You did, but every time you fire up the NM GUI it seems to mess up this file: It changes it, often mistakenly.
I asked you again to post this file because I wanted to find out what NM had done to it. Please do not use NM, or, if you must, please check the interfaces file after you have closed MN down, or, preferably just uninstall it until we have this problem fixed. NM is currently seriously buggy.
Your interfaces file needs the auto line, which should bring it up at boot time:
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
broadcast 192.168.1.255
address 192.168.1.6
netmask 255.255.255.0
gateway 192.168.1.1
Please edit it and save the changes.
Your /etc/resolv.conf file should read like this:
Code:
nameserver 192.168.1.1
Because that is the LAN IP of your router which should route DNS requests to your ISP's DNS server, and relay the result back.
This (nameserver in resolv.conf) is usually set for you automatically if you are using DHCP, but you have to set it manually if you prefer a static LAN IP.
And yeah I have had NM uninstalled for a good few days now. I know I tried to use it when I first installed it, but it didn't seem to do any good either...so that's when I knew I had to manually edit the files.
Manually editing files is strange to windows users, because win likes to hide how it "works".
It's often the fastest and simplest way to get linux to do what you want, because linux isn't ashamed to expose how it works, and there are (as you have discovered) a number of GUI "helpers", some of which are broken. The config files speak for themselves, and are generally very similar across distributions.
Editting config files doesn't really bother me...I actually used Slackware before trying out Ubuntu. In fact, I have used Slackware for the past 2-3 years as my main desktop. I still kept Windows around for a few basic things, but 95% of the time I used Slackware. My thing is just getting used to the Debian way of things versus Slackware. The Debian packaging system is actually what made me change from Slackware....it just took me a while to realize how much better it was.
And yeah I noticed that the GUI tool NM was not cooperating...but I also knew that this was the most recent version of Kubuntu, so I wasn't expecting perfection and everything to be bug free. Command line is good, but I also enjoy command line scripts and tools. Slackware has a really cool command line based tool for networking (netconfig) that will configure networking just fine without any config file editting...assuming you know the settings you want. And even though this is the most recent version and has some bugs, I really have had very little issues with the system...like I said, it's just a matter of learning some of Debian/Ubuntu tricks since I am so used to Slack.
Network manager was done with laptops in mind, making it easier to juggle with multiple connections. There is no reason why it shouldn't have a 'fixed IP' and 'connect at boot' configuration options though but sadly it doesn't afaik
Last edited by dukeinlondon; 01-22-2009 at 04:39 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.