View Single Post

  #3 (permalink)  
Old 12-07-2007, 11:54 AM
anilvrathod's Avatar
anilvrathod anilvrathod is offline
Junior Member
User
 
Join Date: Dec 2007
Location: Pune
My distro: Red Hat
Posts: 13
Rep Power: 0
anilvrathod is on a distinguished road
Default Routing Table

Hi,
Your server act as a Gateway machine , it means your server have 2 NIC.
If your structure is as follow:
WAN IP
|
|
----------------NIC A------------------
| LINUX BOX |
-------------NIC B --------------------
|
|
intranet
suppose NIC (eth0)--- A ---- have a WAN IP such as AAA.AAA.AAA.AAA
NIC (eth1)----B ------have a Local class C IP such as 192.168.1.0-524 (range )
then if you want to write/set routing table then pls do as following :

vi /etc/sysconfig/network-script/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
AAA.AAA.AAA.AAA
GATEWAY=routers' another end IP which is connected to outside of world (WAN IP)
NETMASK=255.255.255.248
ONBOOT=yes
TYPE=Ethernet

vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet



And if your machine have a single NIC then

vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
and add DEFAULT routing table as follow

1.route add default gw AAA.AAA.AAA.AAA(WAN IP )

Reply With Quote