ip forward not work? can't ping from a subnet to b subnet in same TAP interface

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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?







share|improve this question
















  • 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 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 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 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 at 6:06










  • @dirkt Thanks for the suggesting, i'll try it.
    – Henry
    Feb 9 at 6:07














up vote
1
down vote

favorite












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?







share|improve this question
















  • 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 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 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 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 at 6:06










  • @dirkt Thanks for the suggesting, i'll try it.
    – Henry
    Feb 9 at 6:07












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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?







share|improve this question












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?









share|improve this question











share|improve this question




share|improve this question










asked Feb 8 at 5:34









Henry

62




62







  • 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 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 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 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 at 6:06










  • @dirkt Thanks for the suggesting, i'll try it.
    – Henry
    Feb 9 at 6:07












  • 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 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 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 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 at 6:06










  • @dirkt Thanks for the suggesting, i'll try it.
    – Henry
    Feb 9 at 6:07







1




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 at 9:39




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 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 at 13:27




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 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 at 14:46




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 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 at 6:06




@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 at 6:06












@dirkt Thanks for the suggesting, i'll try it.
– Henry
Feb 9 at 6:07




@dirkt Thanks for the suggesting, i'll try it.
– Henry
Feb 9 at 6:07















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422710%2fip-forward-not-work-cant-ping-from-a-subnet-to-b-subnet-in-same-tap-interface%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422710%2fip-forward-not-work-cant-ping-from-a-subnet-to-b-subnet-in-same-tap-interface%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?