I have a network that looks like this:
+--------------+
| Linux Router |
+--------------+
10.0.1.100/24 | 10.0.0.100/24
|
Host A (10.0.1.101/24) ----+--- Host B (10.0.0.3/24)
with 1 caveat: the Linux router only has 1 physical Ethernet port with 2 IP addresses assigned. I need be able to ping 10.0.0.3
from Host A and ping 10.0.1.101
from Host B, but I can't. Why?
[root@Host_A ~]# ping -c1 10.0.0.3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
From 10.0.1.100: icmp_seq=1 Redirect Host(New nexthop: 10.0.0.3)
Then it is Destination Host Unreachable. Here is how my Linux router is configured:
cat /proc/sys/net/ipv4/ip_forward:
1
ip link:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether d0:5f:b8:fc:fc:ef brd ff:ff:ff:ff:ff:ff
ip addr:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d0:5f:b8:fc:fc:ef brd ff:ff:ff:ff:ff:ff
inet 10.0.0.100/24 brd 10.0.0.255 scope global eth0
inet 10.0.1.100/24 brd 10.0.1.255 scope global eth0
inet6 fe80::d25f:b8ff:fefc:fcef/64 scope link
valid_lft forever preferred_lft forever
route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
route -n
? It may only be routing for itself by default. It also might be helpful to know which distribution of Linux you are using.