LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Routing command needed (https://www.linuxquestions.org/questions/linux-networking-3/routing-command-needed-186245/)

carrellc 05-26-2004 05:23 PM

Routing command needed
 
Hiyas!

I need help with this little routing problem this is a quick description of our site setup

I have our main linux box as 10.1.0.1 internally
I just set up a vpn between our site and our new shop. the vpn box internally is set to 10.1.1.1 [same site as 10.1.0.1.At our new shop the vpn is set to 10.12.0.1

if I have 10.1.1.1 as the gateway instead of 10.1.0.1 I can ping the addresses in the 10.12.x.x scope at the new site but then i break my existing other sites connected. Also note if the gate way on a machine on old site has 10.1.1.1 as gateway i can ping it from the 10.12.x.x site as well if its 10.1.0.1 i cannot.

So i need to do a route on the linux server that will have anything that hits the 10.12.x.x scope it goes though 10.1.1.1

whats the command i need for this:) i am pretty frustrated. I know how do modify our firewall that uses iptables and i asume the route line goes in there

Please help me
Clint

slacky 05-26-2004 05:30 PM

You can modify the routing tables with the route command, so something like this (obviously I can't test this myself):
route add -net 10.12.0.0 netmask 255.255.0.0 gw 10.1.1.1

carrellc 05-26-2004 06:00 PM

Hi!
Thx for posting i think we are close this is a redhat 9 box so syntax may be off a bit

i am tryin something like:

ip route add nat 10.12.0.0/24 gw 10.1.1.1

it does not understand the gw syntax may have few syntax few more errors here anyone know command needed? :)

-Clint

Bambi 05-27-2004 08:06 AM

Is it not

ip route add nat 10.12.0.0/24 via 10.1.1.1

carrellc 05-27-2004 04:55 PM

the /24 pooches it :( is i remove it i get no errors but then i am not getting the result i want anymore. is there another way to type that line. Thanks all for posting and trying to help btw

Clint

Bambi 05-28-2004 07:53 AM

What about ...

ip route add nat 10.12.0.0/24 via 10.1.1.1 table local

LuggerHouse 05-28-2004 10:59 AM

Quote:

Originally posted by slacky
You can modify the routing tables with the route command, so something like this (obviously I can't test this myself):
route add -net 10.12.0.0 netmask 255.255.0.0 gw 10.1.1.1

This command is perfectly suitable for a RH9.0 box.

Obviously, this was not what you where looking for. You might have liked an entry to your iptables script.

there is two things to consider:

1- you need to add a route to your routing table before you edit your iptables script
2- after you will need to add an entry to your iptables script in order to nat those adresses.

So there's some reading to be done!!

DOnt give up!


All times are GMT -5. The time now is 09:20 AM.