I have my RHEL 6 image in which eth1 device is configured. When i tried to ping other lab machines in the network.They are not reachable.For my VM to access other machines in the network,I need to add a new route with default gateway to the eth1 device as follows:
Systems with two NIC cards: Typically two cards are used when connecting to two networks. In this case the device must be defined using one of three methods:
- Use the Red Hat GUI tool /usr/bin/netcfg OR
- Define network parameters in configuration files: Define new device in file (Red Hat/Fedora) /etc/sysconfig/network-scripts/ifcfg-eth1
(S.u.s.e 9.2: /etc/sysconfig/network/ifcfg-eth-id-XX:XX:XX:XX:XX)
-
DEVICE=eth1 BOOTPROTO=static IPADDR=192.168.10.12 NETMASK=255.255.255.0 GATEWAY=XXX.XXX.XXX.XXX HOSTNAME=node-name.name-of-domain.com DOMAIN=name-of-domain.com
(Red Hat/Fedora): /etc/sysconfig/static-routes
(S.u.s.e. 9.2: /etc/sysconfig/network/routes) Example:
-
eth1 net XXX.XXX.XXX.0 netmask 255.255.255.0 gw XXX.XXX.XXX.XXX
-
- Define network parameters using Unix command line interface: Define IP address:
ifconfig eth0 XXX.XXX.XXX.XXX netmask 255.255.255.0 broadcast XXX.XXX.XXX.255 ifconfig eth1 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255
If necessary, define route with with the route command:
Examples:
route add default gw XXX.XXX.XXX.XXX dev eth0 route add -net XXX.XXX.XXX.0 netmask 255.255.255.0 gw XXX.XXX.XXX.XXX dev eth0
Where XXX.XXX.XXX.XXX is the gateway to the internet as defined by your ISP or network operator. If a mistake is made just repeat the route command substituting "del" in place of "add".
No comments:
Post a Comment