Find the answer to your Linux question:
Results 1 to 6 of 6
Hey all. Suppose I have computer A with ip address on eth0 of 192.168.0.1 and ip address on eth1 of 192.168.1.1. If I send packets to 192.168.1.1 from computer A, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    3

    Sending packets to localhost through another computer


    Hey all. Suppose I have computer A with ip address on eth0 of 192.168.0.1 and ip address on eth1 of 192.168.1.1. If I send packets to 192.168.1.1 from computer A, it automatically uses the loopback interface. Is it possible to modify the routing table some how to send these packets out on eth0 instead and have them route around the network and come back on eth1. I've tried 'route add -host 192.168.1.1 dev eth0' but it seems to completely ignore this entry.

    Thanks

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Are the eth0 and eth1 physically different devices?
    or eth1 is bridged to eth0? like an alias interface.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    3
    Quote Originally Posted by b2bwild View Post
    Are the eth0 and eth1 physically different devices?
    or eth1 is bridged to eth0? like an alias interface.
    Yep they are physically different devices.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    You should try using 'ip route'
    but remeber you'll need a gateway
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  6. #5
    Just Joined!
    Join Date
    Jun 2009
    Posts
    3
    Quote Originally Posted by b2bwild View Post
    You should try using 'ip route'
    but remeber you'll need a gateway
    Slight progress. I tried 'ip route change 192.168.1.1 via 192.168.0.2' (192.168.0.2 is the IP address of the computer directly connected to A's eth0).

    Now if I ping 192.168.1.1 from A, the packets are going to eth0 as desired, but the other computer is replying with "Destination Host Prohibited" even though that computer has 192.168.1.1 in its routing table.

    Thanks for the help so far

  7. #6
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    You also need to do routing on gatway machine.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

Posting Permissions

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