ip forward not work? can't ping from a subnet to b subnet in same TAP interface
Clash 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?
networking routing bridge
 |Â
show 1 more comment
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?
networking routing bridge
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 betweeneth3
andl2tp_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 continousping
from PcA to PcB, and test withtcpdump
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 be169.6.211.10/24
and169.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
 |Â
show 1 more comment
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?
networking routing bridge
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?
networking routing bridge
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 betweeneth3
andl2tp_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 continousping
from PcA to PcB, and test withtcpdump
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 be169.6.211.10/24
and169.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
 |Â
show 1 more comment
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 betweeneth3
andl2tp_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 continousping
from PcA to PcB, and test withtcpdump
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 be169.6.211.10/24
and169.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
 |Â
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
andl2tp_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 continousping
from PcA to PcB, and test withtcpdump
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
and169.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