Find the answer to your Linux question:
Results 1 to 3 of 3
Heres the setup: I have 2 machines on 2 different subnets (192.168.1.2) (192.168.2.2) traffic is passing thru 2 cisco switches i added the route to the 192.168.2.0 network on machine1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    11

    Static Routes


    Heres the setup:
    I have 2 machines on 2 different subnets (192.168.1.2) (192.168.2.2)
    traffic is passing thru 2 cisco switches

    i added the route to the 192.168.2.0 network on machine1
    route add -net 192.168.2.0/24 gw 192.168.1.1

    now if i added this route to machine1, i should be able to hit whatever is in the 192.168.2.0 network? i wasnt able to so i added the
    route add -net 192.168.1.0/24 gw 192.168.2.1 to machine 2 and i was able to finally hit it. i thought by adding a static route on one machine it knows the path to the other network. why did i have to add the route to the incoming network on machine2? hope this makes sense

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Do you have default routes setup on your machines?
    If so you should not need to add these routes.

    What does the following give you;

    Code:
    route -n

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    682
    You needed to add the network static route on the first machine so it knew how to find the network of the second machine. In the same way, the second machine needed to know how to send traffic back.

    As lazydog says, you may be able to set up the switches so all this is handled transparently.

    Let us know how you get on,

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

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