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. |
Using CLI :
route add default gw <your default gateway address> eth0 or route add -net default gw <your default gateway address> eth0 |
GUI make things beautiful , but CLI make them fast and strong .
|
Quote:
Quote:
GATEWAY=192.168.200.1 and saw this error as it was restarting: Quote:
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. |
Quote:
|
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? |
Place command above to your ~/.bashrc or /etc/profile (RedHat , Fedora) and /etc/bash.bashrc (I don't remember exactly) on SuSE .
|
Suse uses /etc/init.d/boot.local or /etc/boot.local like Redhat uses rc.local for startup scripts.
|
Good Day,
I make cahnges to file /etc/sysconfig/network/routes But when I restart computer it disappears. Suse writes down its on default entries. How could I stop suse from updating the file. |
All times are GMT -5. The time now is 07:45 PM. |