Route data between two interfaces

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











up vote
0
down vote

favorite












I try to route packets between two interfaces of a virtual Ubuntu 16.04 machine hosted in OpenStack. Following what I found on Internet, here is what I did:



# Enable ip forwarding:
sysctl -w net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward = 1' >> net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf

# Update IP tables:
iptables -A FORWARD -i ens3 -o ens4 -j ACCEPT
iptables -A FORWARD -i ens4 -o ens3 -j ACCEPT


Now, here is my Linux router interfaces and routing table:



ens3: 192.168.217.6/24
ens4: 10.0.0.13/24

ip route
default via 10.0.0.1 dev ens4
10.0.0.0/26 dev ens4 proto kernel scope link src 10.0.0.13
169.254.169.254 via 10.0.0.1 dev ens4
192.168.217.0/24 dev ens3 proto kernel scope link src 192.168.217.6


I have a machine on LAN 10.0.0.0/24, and one on LAN 192.168.217.0/24. Both have my Linux router as their default gateway, but they can't ping each other. However, machine on LAN 10.0.0.0/24 has Internet access:



traceroute 1.1.1.1
10.0.0.1
...
1.1.1.1

ip route
default via 10.0.0.13 dev eth0
10.0.0.0/24 dev eth0 10.0.0.14


This is strange, as the traceoute do not use 10.0.0.13, which is the default gateway of my host.



What am I doing wrong ? Thank you.







share|improve this question





















  • Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
    – wurtel
    Jun 22 at 10:05










  • @wurtel Updated.
    – Nakrule
    Jun 22 at 10:35










  • You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
    – pawel7318
    Jun 22 at 11:57











  • @pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
    – Nakrule
    Jun 22 at 12:16










  • If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
    – wurtel
    Jun 22 at 13:05














up vote
0
down vote

favorite












I try to route packets between two interfaces of a virtual Ubuntu 16.04 machine hosted in OpenStack. Following what I found on Internet, here is what I did:



# Enable ip forwarding:
sysctl -w net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward = 1' >> net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf

# Update IP tables:
iptables -A FORWARD -i ens3 -o ens4 -j ACCEPT
iptables -A FORWARD -i ens4 -o ens3 -j ACCEPT


Now, here is my Linux router interfaces and routing table:



ens3: 192.168.217.6/24
ens4: 10.0.0.13/24

ip route
default via 10.0.0.1 dev ens4
10.0.0.0/26 dev ens4 proto kernel scope link src 10.0.0.13
169.254.169.254 via 10.0.0.1 dev ens4
192.168.217.0/24 dev ens3 proto kernel scope link src 192.168.217.6


I have a machine on LAN 10.0.0.0/24, and one on LAN 192.168.217.0/24. Both have my Linux router as their default gateway, but they can't ping each other. However, machine on LAN 10.0.0.0/24 has Internet access:



traceroute 1.1.1.1
10.0.0.1
...
1.1.1.1

ip route
default via 10.0.0.13 dev eth0
10.0.0.0/24 dev eth0 10.0.0.14


This is strange, as the traceoute do not use 10.0.0.13, which is the default gateway of my host.



What am I doing wrong ? Thank you.







share|improve this question





















  • Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
    – wurtel
    Jun 22 at 10:05










  • @wurtel Updated.
    – Nakrule
    Jun 22 at 10:35










  • You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
    – pawel7318
    Jun 22 at 11:57











  • @pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
    – Nakrule
    Jun 22 at 12:16










  • If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
    – wurtel
    Jun 22 at 13:05












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I try to route packets between two interfaces of a virtual Ubuntu 16.04 machine hosted in OpenStack. Following what I found on Internet, here is what I did:



# Enable ip forwarding:
sysctl -w net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward = 1' >> net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf

# Update IP tables:
iptables -A FORWARD -i ens3 -o ens4 -j ACCEPT
iptables -A FORWARD -i ens4 -o ens3 -j ACCEPT


Now, here is my Linux router interfaces and routing table:



ens3: 192.168.217.6/24
ens4: 10.0.0.13/24

ip route
default via 10.0.0.1 dev ens4
10.0.0.0/26 dev ens4 proto kernel scope link src 10.0.0.13
169.254.169.254 via 10.0.0.1 dev ens4
192.168.217.0/24 dev ens3 proto kernel scope link src 192.168.217.6


I have a machine on LAN 10.0.0.0/24, and one on LAN 192.168.217.0/24. Both have my Linux router as their default gateway, but they can't ping each other. However, machine on LAN 10.0.0.0/24 has Internet access:



traceroute 1.1.1.1
10.0.0.1
...
1.1.1.1

ip route
default via 10.0.0.13 dev eth0
10.0.0.0/24 dev eth0 10.0.0.14


This is strange, as the traceoute do not use 10.0.0.13, which is the default gateway of my host.



What am I doing wrong ? Thank you.







share|improve this question













I try to route packets between two interfaces of a virtual Ubuntu 16.04 machine hosted in OpenStack. Following what I found on Internet, here is what I did:



# Enable ip forwarding:
sysctl -w net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward = 1' >> net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf

# Update IP tables:
iptables -A FORWARD -i ens3 -o ens4 -j ACCEPT
iptables -A FORWARD -i ens4 -o ens3 -j ACCEPT


Now, here is my Linux router interfaces and routing table:



ens3: 192.168.217.6/24
ens4: 10.0.0.13/24

ip route
default via 10.0.0.1 dev ens4
10.0.0.0/26 dev ens4 proto kernel scope link src 10.0.0.13
169.254.169.254 via 10.0.0.1 dev ens4
192.168.217.0/24 dev ens3 proto kernel scope link src 192.168.217.6


I have a machine on LAN 10.0.0.0/24, and one on LAN 192.168.217.0/24. Both have my Linux router as their default gateway, but they can't ping each other. However, machine on LAN 10.0.0.0/24 has Internet access:



traceroute 1.1.1.1
10.0.0.1
...
1.1.1.1

ip route
default via 10.0.0.13 dev eth0
10.0.0.0/24 dev eth0 10.0.0.14


This is strange, as the traceoute do not use 10.0.0.13, which is the default gateway of my host.



What am I doing wrong ? Thank you.









share|improve this question












share|improve this question




share|improve this question








edited Jun 22 at 10:34
























asked Jun 22 at 7:55









Nakrule

1465




1465











  • Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
    – wurtel
    Jun 22 at 10:05










  • @wurtel Updated.
    – Nakrule
    Jun 22 at 10:35










  • You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
    – pawel7318
    Jun 22 at 11:57











  • @pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
    – Nakrule
    Jun 22 at 12:16










  • If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
    – wurtel
    Jun 22 at 13:05
















  • Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
    – wurtel
    Jun 22 at 10:05










  • @wurtel Updated.
    – Nakrule
    Jun 22 at 10:35










  • You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
    – pawel7318
    Jun 22 at 11:57











  • @pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
    – Nakrule
    Jun 22 at 12:16










  • If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
    – wurtel
    Jun 22 at 13:05















Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
– wurtel
Jun 22 at 10:05




Add the ip route output of the "machine on LAN 10.0.0.0/24" to the question.
– wurtel
Jun 22 at 10:05












@wurtel Updated.
– Nakrule
Jun 22 at 10:35




@wurtel Updated.
– Nakrule
Jun 22 at 10:35












You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
– pawel7318
Jun 22 at 11:57





You have a few mistakes in the first part ("# Enable ip forwarding"), so please make sure you have this really set with sysctl -a|grep net.ipv4.ip_forward
– pawel7318
Jun 22 at 11:57













@pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
– Nakrule
Jun 22 at 12:16




@pawel7318 cat /proc/sys/net/ipv4/ip_forwarding return 1.
– Nakrule
Jun 22 at 12:16












If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
– wurtel
Jun 22 at 13:05




If on 10.0.0.14 you have 10.0.0.13 as default gateway, but 10.0.0.13 has 10.0.0.1 as default gateway, then 10.0.0.13 will send an ICMP REDIRECT back to 10.0.0.14 so that 10.0.0.13 doesn't have to waste time retransmitting a packet on the same network where it came from. That explains the traceroute not showing 10.0.0.13. However it doesn't explain why you can't ping between the networks.
– wurtel
Jun 22 at 13:05















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%2f451243%2froute-data-between-two-interfaces%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%2f451243%2froute-data-between-two-interfaces%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?