Monday, August 29, 2011

Adding default Gateway in Linux SUSE

Changing the default route permanently in SuSe Linux
To make as default route, add the following line into /etc/sysconfig/network/routes file. (Create a file if it does not exist.)

default - -

Syntax: default - -

Linux route add using route command
Route all traffic via gateway connected via eth0 network interface:
# route add default gw eth0

Linux route add using ip command
Just like above but with ip command:# ip route add dev eth0
 route add -net default gw gateway_ip_address

Change IP address
You can change ip address using ifconfig command itself. To set IP address, enter command:# ifconfig eth0 netmask up
# ifconfig eth0