1

I am trying to get copied packets from machine A to machine B. When I ping machine B from machine A, I get a ping response. When I ping machine A from machine B, I don't get a response. Machine A has 1 network interface. Machine B has two network interfaces with eth0 on a different subnet than machine A and eth1 on the same subnet as machine A.

Machine B (eth1) can ping 10.0.3.1 (gateway), but not 10.0.3.100 (machine A).

Both machines are running on AWS.

Here is machine B (ping not working):

SELinux set to permissive.

iptables -L:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

ip route show table all:

default via 10.0.3.1 dev eth1 table 1000
10.0.3.102 dev eth1 table 1000 scope link
default via 10.0.4.1 dev eth0
10.0.3.0/24 dev eth1 proto kernel scope link src 10.0.3.102
10.0.4.0/24 dev eth0 proto kernel scope link src 10.0.4.100
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
broadcast 10.0.3.0 dev eth1 table local proto kernel scope link src 10.0.3.102
local 10.0.3.102 dev eth1 table local proto kernel scope host src 10.0.3.102
broadcast 10.0.3.255 dev eth1 table local proto kernel scope link src 10.0.3.102
broadcast 10.0.4.0 dev eth0 table local proto kernel scope link src 10.0.4.100
local 10.0.4.100 dev eth0 table local proto kernel scope host src 10.0.4.100
broadcast 10.0.4.255 dev eth0 table local proto kernel scope link src 10.0.4.100
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
unreachable ::/96 dev lo metric 1024 error -113 pref medium
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113 pref medium
unreachable 2002:a00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:7f00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:ac10::/28 dev lo metric 1024 error -113 pref medium
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:e000::/19 dev lo metric 1024 error -113 pref medium
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113 pref medium
fe80::/64 dev eth0 proto kernel metric 256 mtu 9001 pref medium
fe80::/64 dev eth1 proto kernel metric 256 mtu 9001 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium
local ::1 dev lo table local proto unspec metric 0 pref medium
local fe80::3f:c2ff:fe84:c930 dev lo table local proto unspec metric 0 pref medium
local fe80::ff:4ff:fefb:9a86 dev lo table local proto unspec metric 0 pref medium
ff00::/8 dev eth0 table local metric 256 mtu 9001 pref medium
ff00::/8 dev eth1 table local metric 256 mtu 9001 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium

ip rule show table 1000:

32764:  from all to 10.0.3.102 lookup 1000
32765:  from 10.0.3.102 lookup 1000

ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 10.0.4.100  netmask 255.255.255.0  broadcast 10.0.4.255
        inet6 fe80::3f:c2ff:fe84:c930  prefixlen 64  scopeid 0x20<link>
        ether someMac  txqueuelen 1000  (Ethernet)
        RX packets 1497  bytes 125307 (122.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1198  bytes 120891 (118.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 10.0.3.102  netmask 255.255.255.0  broadcast 10.0.3.255
        inet6 fe80::ff:4ff:fefb:9a86  prefixlen 64  scopeid 0x20<link>
        ether someMac  txqueuelen 1000  (Ethernet)
        RX packets 88  bytes 5003 (4.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 105  bytes 6414 (6.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6  bytes 416 (416.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 416 (416.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is machine A:

iptables -L:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

iptables -t mangle -L:

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
TEE        all  --  anywhere             anywhere             TEE gw:ip-10-0-3-102.ec2.internal

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

ip route show table all:

default via 10.0.3.1 dev eth0
10.0.3.0/24 dev eth0 proto kernel scope link src 10.0.3.100
169.254.0.0/16 dev eth0 scope link metric 1002
broadcast 10.0.3.0 dev eth0 table local proto kernel scope link src 10.0.3.100
local 10.0.3.100 dev eth0 table local proto kernel scope host src 10.0.3.100
broadcast 10.0.3.255 dev eth0 table local proto kernel scope link src 10.0.3.100
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
unreachable ::/96 dev lo metric 1024 error -113 pref medium
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113 pref medium
unreachable 2002:a00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:7f00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:ac10::/28 dev lo metric 1024 error -113 pref medium
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:e000::/19 dev lo metric 1024 error -113 pref medium
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113 pref medium
fe80::/64 dev eth0 proto kernel metric 256 mtu 9001 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium
local ::1 dev lo table local proto unspec metric 0 pref medium
local fe80::c0:a5ff:fe89:d238 dev lo table local proto unspec metric 0 pref medium
ff00::/8 dev eth0 table local metric 256 mtu 9001 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium

ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 10.0.3.100  netmask 255.255.255.0  broadcast 10.0.3.255
        inet6 fe80::c0:a5ff:fe89:d238  prefixlen 64  scopeid 0x20<link>
        ether someMac  txqueuelen 1000  (Ethernet)
        RX packets 8096  bytes 4591057 (4.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6275  bytes 521551 (509.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6  bytes 416 (416.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 416 (416.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I am trying to get a copy of all traffic from machine A (eth0) to machine B (eth1) while still having use of machine B (eth0) for accessing the internet (which works right now). I think this is a routing issue, but I can't find the problem and most searches seem to refer to firewall issues (see iptables), netmask (they match), and routing (I can't find the issue).

The mangle table seems to be incrementing count, so packets are being copied, but tcpdump shows there are no packets received by machine B (eth1). This is the end goal ^

/etc/sysconfig/network:

NETWORKING=yes
GATEWAYDEV=eth0

/etc/sysconfig/network-scripts/ifcfg-eth1:

DEVICE=eth1
NAME=eth1
HWADDR=02:ff:04:fb:9a:86
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
NM_CONTROLLED=no
IPADDR=10.0.3.102
NETMASK=255.255.255.128

/etc/sysconfig/network-scripts/route-eth1:

default via 10.0.3.1 dev eth1 table 1000
10.0.3.102 dev eth1 table 1000

/etc/sysconfig/network-scripts/rule-eth1:

from 10.0.3.102 lookup 1000
to 10.0.3.102 lookup 1000
  • I can't see where the suggested post departs from my config. Could you please explain? – neoinageo Apr 24 at 22:10
  • why from 10.0.3.102 lookup 1000 ? – Ralph Rönnquist Apr 25 at 10:28
  • It's better to list the route tables separately, I now can't see what table 1000 contains while that's referenced. You first list machine B's config, then machine A, and then again the machine B sysconfig files?! Show also ip ro get 10.0.3.102 (.102 is machine B, right? Not clear) from the 10.0.3.100 system (machine A?) and the reverse. – wurtel Apr 25 at 14:04
  • I added machine B config after someone commented that I should add those files. That person then deleted the comment. – neoinageo Apr 25 at 15:00
0

I solved the issue. It was an AWS security group that was not set up correctly and blocked ingress. ip rule was changed from "from 10.0.3.102" to "from 10.0.3.100". The rest of the setup was correct.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.