How to Assign Default gateway in linux?
Ans : In linux Default gateway is set through route command or GUI tools.
Through Route command
#route add default gw default-gateway
Example :
#route add default gw 192.168.0.1
Here 192.168.0.1 is the default gate of my system.
Through GUI tools
Use system-config-network in terminal or GUI to set up default gateway.
Archive for July, 2010
This is asked in some of the interviews. We can get default gateway information in linux in many ways. Such as viewing network card file or executing a command.
To see default gateway by view network interface card file content.
#cat /etc/sysconfig/networking/devices/interface-no
Example :
[root@example ~]# cat /etc/sysconfig/networking/devices/ifcfg-eth0
# Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:02:a5:4c:af:99
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=10.200.0.21
GATEWAY=10.200.0.1
Through route command
route
Example:
Kernel IP routing table
Destination Gateway … Continue Reading
Computers are assigned with a name as we do for humans beings. This is called hostname in computer world. So how to assign a hostname to a Linux system? Its very much simple. Before doing this we should know every task in Linux can be done in two ways :
1. Temporary way(once you boot your system the changes made in this way will go away)
2. Permanent way(Changes made in this way will be … Continue Reading







