Tuesday, 31 January 2012

Making your VMLinux access other machines

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:
  1. Use the Red Hat GUI tool /usr/bin/netcfg OR

  2. 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)

    Special routing information may be specified, if necessary, in the file
    (Red Hat/Fedora): /etc/sysconfig/static-routes

    (S.u.s.e. 9.2: /etc/sysconfig/network/routes)
    eth1 net XXX.XXX.XXX.0 netmask gw XXX.XXX.XXX.XXX

  3. Define network parameters using Unix command line interface: Define IP address:
        ifconfig eth0  XXX.XXX.XXX.XXX netmask broadcast XXX.XXX.XXX.255
        ifconfig eth1   netmask broadcast
    If necessary, define route with with the route command:

      route add default gw XXX.XXX.XXX.XXX dev eth0
      route add  -net  XXX.XXX.XXX.0  netmask 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

Tweets by @sriramperumalla