You are not logged in.

#1 2004-10-10 08:14:43

orjanp
Member
From: Tromsoe, Norway
Registered: 2004-07-03
Posts: 347

Routing between three subnets

I havet three computers. Two laptops and one stationary. I will use the stationary as a router. It has three nics. Here is what I'm trying to apply.

The two laptops shuld be at two different subnets(10.0.2.0 and 10.0.1.0). The router should route the traffic between them.

My configuration is like this:

Laptop 1

eth0
  ip - 10.0.1.20, netmask 255.255.255.0, broadcast 10.0.1.255

Routing table
Destination     Gateway         Genmask     Flags Metric Ref  Use   Iface
  10.0.1.0          *         255.255.255.0   U     0     0    0     eth0
  default       10.0.1.1        0.0.0.0       UG    0     0    0     eth0

Router

eth0
  ip - 10.0.0.105, netmask 255.255.255.0, broadcast 10.0.0.255

eth1
  ip - 10.0.1.1, netmask 255.255.255.0, broadcast 10.0.1.255

eth2
  ip - 10.0.2.1, netmask 255.255.255.0, broadcast 10.0.2.255

Routing table
Destination     Gateway        Genmask       Flags Metric Ref  Use   Iface
  10.0.0.0          *        255.255.255.0     U     0     0    0     eth0
  10.0.1.0          *        255.255.255.0     U     0     0    0     eth1
  10.0.2.0          *        255.255.255.0     U     0     0    0     eth2
   default      10.0.0.1       0.0.0.0         UG    0     0    0     eth0

Laptop 2

eth0
  ip - 10.0.2.20, netmask 255.255.255.0, broadcast 10.0.2.255

Routing table
Destination     Gateway        Genmask       Flags Metric Ref  Use   Iface
  10.0.2.0          *        255.255.255.0     U     0     0    0     eth0
   default      10.0.2.1       0.0.0.0         UG    0     0    0     eth0

When I ping laptop 2 from laptop 1, I receive the ping on eth1 on the router, but it doesn't go any further. The same goes from laptop 2 to laptop 1, but I receive the ping on eth2 on the router. I can ping all interfaces on the router from both laptops. But I can't ping computers on the subnet 10.0.0.0 from any of the laptops. Pinging on the subnet 10.0.0.0 from the router is no problem. It's not possibe to ping 10.0.1.20 and 10.0.2.20 from a computer on the 10.0.0.0 subnet.

Is there something I'm missing?


Ørjan Pettersen

Offline

#2 2004-10-10 08:31:56

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Routing between three subnets

any firewall rules on the router?

also, here is a decent doc on linux routing
http://lartc.org/howto/index.html
and this
http://linux-ip.net/html/index.html

maybe others can provide their useful links. I am not at home right now, so I don't have further info at present...


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2004-10-10 08:35:09

orjanp
Member
From: Tromsoe, Norway
Registered: 2004-07-03
Posts: 347

Re: Routing between three subnets

No firewall yet.

Thanks for the links. I'll have a look. smile


Ørjan Pettersen

Offline

#4 2004-10-10 10:45:49

orjanp
Member
From: Tromsoe, Norway
Registered: 2004-07-03
Posts: 347

Re: Routing between three subnets

Part of the problem was solved by a

# echo 1 > /proc/sys/net/ipv4/ip_forward

Enable ip forwarding  roll

Now I can ping from one laptop to another, but I can't ping from a laptop to the 10.0.0.0 subnet. It's no problem to ping from the router itself to the 10.0.0.0 network. It might be because the router is a dhcp client of a nother firewalled router that gives out adresses on the 10.0.0.0 subnet. I have tried to disable the firewall and allow internet ping on that router without any luck.

So my experimental network looks like this at the moment.

Laptop1 ___ Switch === Router1 ____ Switch ___ Router2 ___ internet
Laptop2 _____|                          |_____ 10.0.0.0 subnet

This is the status now:
laptop1 can ping router1 and laptop2
laptop2 can ping router1 and laptop1
router1 can ping everything including internet hosts

I guess the problem is located in router2 since I can see the ping packet leaving eth0 on laptop2, arriving on eth2 and leaving eth0 on router1. And then it's quiet.
The log on router2 is not logging much, so it's at no help.


Ørjan Pettersen

Offline

#5 2004-10-10 12:31:12

Aletheuo
Member
Registered: 2004-03-26
Posts: 59

Re: Routing between three subnets

The default gateway of each laptop's ip should be on the same subnet as the laptop's ip.
For example, if one laptop's ip address is, 10.0.1.1, the default gateway should be on the same subnet, like 10.0.1.2, and the same for the other laptop.

Craig


Arch Linux (Duke)
JabberID:  cgill27@jabber.org
IRC: Aletheuo
Registered Linux User #354975

Offline

#6 2004-10-10 17:26:16

orjanp
Member
From: Tromsoe, Norway
Registered: 2004-07-03
Posts: 347

Re: Routing between three subnets

My mistake. The routing table is of course wrong for the laptops. It has been fixed. Thanks for pointing that out.

I don't think I'll try to fix the router2 problem since it's a wireless gateway/router/firewall ting from SMC. And it's not much to configure in it.

But is there a chance that it is the router2 that is causing the problem now?


Ørjan Pettersen

Offline

#7 2004-10-10 20:06:22

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Routing between three subnets

unlikely, according to your diagram.
can you post an updated routing table for router1, and what is the ip of the internal interface of router2..?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB