1

Hi all, I am new to linux networking, had a question about routing lan to lan with a TAP interface.

My Topology:

          L2tp_Server
       [tap_lan2lan_lab]
       169.6.211.254/24
              |
              |
    ----------------------
    |                    |
    |                    |
169.6.211.10/32       169.6.211.20/32
[l2tp_out]            [l2tp_out]
RouterA               RouterB
[eth3]                [eth3]
192.168.100.1/24      192.168.200.1/24
    |                    |
    |                    |
192.168.100.100/24    192.168.200.200/24
   PcA                  PcB

On L2tp_Server, i added the route in TAP interface:

ip route add 192.168.100.0/24 via 169.6.211.10 dev tap_lan2lan_lab src 169.6.211.254
ip route add 192.168.200.0/24 via 169.6.211.20 dev tap_lan2lan_lab src 169.6.211.254

sysctl on L2tp_Server:

sysctl -w net.ipv4.ip_forward = 1

iptables on L2tp_Server:

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
2    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

route on RouterA:

169.2.211.0/24 dev l2tp_out
192.168.200.0/24 dev l2tp_out

route on RouterB:

169.6.211.0/24 l2tp_out
192.168.100.0/24 l2tp_out



Now the Trouble is:

On subnet 169.6.211.0/24 is all connected and can ping to each other. But subnet 192.168.100.0/24 and 192.168.200.0/24 can't ping to each other.

What problem in my topology? Maybe the topology is false?

  • 1
    I don't know what you're using to operate the tap device, but with openvpn the routing between connected clients can be handled by openvpn itself, so the kernel routing tables isn't involved in that case. You might be in the same situation. Try e.g.tcpdump on the tap device to see if you can see the pings from one client net to the other. – wurtel Feb 8 '18 at 9:39
  • Is forwarding on RouterA and RouterB enabled? After all, it's those routers that have to forward packets between eth3 and l2tp_out. On L2tp_Server, where you enabled forwarding, you've shown only one interface, so this forwarding is not relevant for your topology. Do PcA and PcB have correct routes/default routes (via 192.168.100.1 resp. 192.168.200.1)? If it still doesn't work, do a continous ping from PcA to PcB, and test with tcpdump on each interface in order if you see packets. – dirkt Feb 8 '18 at 13:27
  • One more thing that caught my eye: the addresses on RouterA and RouterB should be 169.6.211.10/24 and 169.6.211.20/24, not /32. – Johan Myréen Feb 8 '18 at 14:46
  • @wurtel Thanks for the reply, i think that's why my network is not work, i used a vpn software in server, and i created a tap interface to bridge the vpn user to each other vpn user in the interface. so if the routing is handled by software, that can explain my network problem, great thanks. – Henry Feb 9 '18 at 6:06
  • @dirkt Thanks for the suggesting, i'll try it. – Henry Feb 9 '18 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.