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

My Topology:

    |                    |
    |                    |
[l2tp_out]            [l2tp_out]
RouterA               RouterB
[eth3]                [eth3]
    |                    |
    |                    |
   PcA                  PcB

On L2tp_Server, i added the route in TAP interface:

ip route add via dev tap_lan2lan_lab src
ip route add via dev tap_lan2lan_lab src

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  --             
2    ACCEPT     all  --  

route on RouterA: dev l2tp_out dev l2tp_out

route on RouterB: l2tp_out l2tp_out

Now the Trouble is:

On subnet is all connected and can ping to each other. But subnet and 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 resp. 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 and, 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.