Click to See Complete Forum and Search --> : routing


Crucificator
03-14-2003, 11:22 AM
Ok. So I'm routing now...
Or at least I'm trying ...

I am behind a router. So if I want someone to access me I can't give him/her my IP.
So I try to create a route netween me and x to be able to access him.

my IP: 192.168.1.x, my gw a.a.a.a
his IP: 10.0.0.y, his gw b.b.b.b

I do:
route add -net 10.0.0.0 netmask 255.255.255.0 gw b.b.b.b

meaning (I think) that for every ip address that matches 10.0.0.y packets should be forwarded to his gateway.
Still, when I'm issuing this rule it tells me that

SIOCADDRT: Network is unreachable

I don't understand the error. Can someone help me?

chrism01
03-14-2003, 11:29 AM
FYI: the following are reserved network address ranges and should never be used on the public internet, only internally behind a NAT/masq with a real IP supplied by your isp:

10.0.0.0 - 10.255.255.255 (1) Class A
172.16.0.0 - 172.31.255.255 (16) Class B
192.168.0.0 - 192.168.255.255 (256) Class C

Also,
127.0.0.0 - 127.255.255.255 (1) Class A
known as the loopback network. Localhost default = 127.0.0.1

HTH

cowanrl
03-16-2003, 05:00 PM
As chrism01 indicated, if there is an Internet connection between you and your friend, you are not going to be able to route packets between yourselves when you are both using private IP addresses. You would have to use some kind of IP masquerading.

However, if you both work for the same company and there is no Internet link between you, you could both use private IP addresses on different subnets and communicate.
On your machine, when you created the static route, you would not put the address of his gateway(b.b.b.b) as the gateway for the static route, you would use your gateway(a.a.a.a).
Whatever router has the address of a.a.a.a would have to know a route to the 10.0.0.0 network or have a default gateway set up that would allow the packet to be routed to the 10.0.0.0 network.

Any time you create a static route, the gateway address for that route has to be on the same subnet as the interface the packets will go out on.