Making default gateway address permanent in SuSe 10
SUSE / openSUSEThis Forum is for the discussion of Suse 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.
Making default gateway address permanent in SuSe 10
I just installed SuSe for the first time on my home network. We used it at work for a mail server, but other than manage user accounts, I didn't mess with it much. I've generally used Red Hat distros up until now.
In SuSe 10, I can't figure out how to permanantly add a default gateway through the CLI. In Red Hat, it's just a matter of adding a line to /etc/sysconfig/network or /etc/sysconfig/network-scripts/ifcfg-eth0, depending on the setup. Niether of these files exist in my fresh install of SuSe 10.
I've done quite a bit of Googling, and came up with two sites that said to edit etc/rc.d/rc.local in SuSe. Unfortunately, this file does not exist either. I need to know how to make the gateway permanent using the command line. Can I just create rc.local in /etc/rc.d, or is there somewhere else I should be making the default gateway address permanent?
You can do that in YaST. Go to the Network Devices --> Network Card setup dialog. Select your NIC or wireless device and click on Edit.
In the Detailed Settings area on the bottom of the window, click on Routing.
This is where you enter the default gateway for the device.
There will be a file created named /etc/sysconfig/network/routes. I think that the manual way of doing it would be to add a route using ifconfig and then running SuSEconfig, but I'm not certain if SuSEconfig would pick up the change without actually trying it.
I regularly use this command for adding a gateway, but I need to make it permanent. This does not.
Quote:
Originally Posted by jschiwal
You can do that in YaST. Go to the Network Devices --> Network Card setup dialog. Select your NIC or wireless device and click on Edit.
I tried manually creating the file /etc/sysconfig/network/routes and adding:
GATEWAY=192.168.200.1
and saw this error as it was restarting:
Quote:
noiface Error while executing:
Command 'ip route replace to GATEWAY=192.168.200.1' returned:
Error: an inet prefix is expected rather than "GATEWAY=192.168.200.1".
Configuration line: GATEWAY=192.168.200.1
and still had no gateway listed when I run route.
edit: I finally figured out that the format for the routes file is:
default 192.168.200.1 - -
rather than what I was trying before. That seems to have taken care of it.
Last edited by alienmagic; 02-26-2006 at 11:15 PM.
Do you mean putting the command in /etc/rc.d/init.d or /etc/rc.d/rc.local?
Neither of those files exists. Is there another file I should add the command to?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.