Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problem routing packets from one interface to another

    hi, i have a system with 2 interfaces eth0, and eth1. eth0 is and connected to gateway
    eth1 is connected to via a swtich.

    i am trying to route packets from to gateway, which means i need to route 192.123.123.x packets coming into eth1 interface out via eth0 interface.

    i set ip_forward file to 1.
    i ran this command:
    route add -net netmask dev eth0
    route add default gw

    i can ping from to, but i can't ping to
    i think packets are not being forwarded to eth0.

    my routing table looks something like this:

    gteway Genmask Flags Ref Iface * U eth1 * U eth0 * U eth0
    default UG eth0

    can anyone tell me what is missing?
    thank you in advance.

  2. #2
    Hi markch,
    not totally sure what you are trying to do here.

    _eth0:<------->Default: (assuming a router here).

    What is your switch connected to?

    From the pc you should be able to ping either interface and also the default gateway.
    Pinging the interfaces should always work as it never leaves the box itself.
    Pinging the default gateway will only work out of the eth0 as it is directly connected.
    If it is avaliable you should be able to ping it and see the arp address associated against eth0.
    using arping is a good way to verify.

    arping -I eth0
    This should reply with something like reply from mac address xxx:xxx:xxx:xxx:xxx

    The route for the out eith0 is not necessary unless you have another network in this range sitting behind the router.
    The connected more specific netowork out eth1 is what will be used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts