The environment is FreeBSD for the most part and looks like this:HOST_A <-> ROUTER <-> LOKI <-> HOST_BMinimally, I would like to be able to ping ROUTER from HOST_B.ROUTER is assigned the IP 10.0.0.1LOKI is a multi-homed machine that is assigned IPs 10.0.0.2 and 192.168.200.1HOST_B is assigned the IP 192.168.200.3HOST_A is assigned the IP 10.0.0.3I have set the network up as above and added gateway_enable=YES to loki's rc.confnetstat -r on LOKI produces:Routing tablesInternet:Destination        Gateway            Flags      Netif Expiredefault            10.0.0.1           UGS         em010.0.0.0           link#1             U           em010.0.0.2           link#1             UHS         lo0loki               link#2             UH          lo0192.168.200.0      link#3             U           ue0192.168.200.1      link#3             UHS         lo0which looks like a fine routing table and appears to work in all directions.netstat -r on HOST_B produces:Routing tablesInternet:Destination        Gateway            Flags      Netif Expiredefault            192.168.200.1      UGS         em0hostb              link#2             UH          lo0192.168.200.0      link#1             U           em0192.168.200.3      link#1             UHS         lo0which looks like another fine routing table, but is only able to see LOKI.In summary:LOKI is able to ping HOST_A, HOST_B and ROUTERHOST_B is able to ping LOKI, but not ROUTER or HOST_ASome additional notes:from HOST_Bping 10.0.0.1 100% packet lossIn wireshark on LOKI, while pinging 10.0.0.1 from HOST_B:120 40.549564000    192.168.200.3   10.0.0.1    ICMP    98  Echo (ping) request  id=0x5a0e, seq=92/23552, ttl=63 (no response found!)It appears to me that nothing is being routed from LOKI to ROUTER. What am I missing?I confirmed that IP forwarding was taking place by commenting out gateway_enable=YES in /etc/rc.conf and rebooting.Then, I ran the following commands on loki:sudo tcpdump -i em0 -nSsudo tcpdump -i ue0 -nSto monitor activity on the two nics. from hostb, I ran:ping 10.0.0.1the ue0 interface on 192.168.200.1 reported:14:44:21.870865 IP 192.168.200.3 > 10.0.0.1: ICMP echo request, id 21509, seq 0, length 64nothing was reported on the em0 interface on 10.0.0.2.I then ran:sudo sysctl -w net.inet.ip.forwarding=1and sure enough, em0 reported:14:58:14.745369 IP 192.168.200.3 > 10.0.0.1: ICMP echo request, id 25861, seq 0, length 64But no, reply such as what I get with a ping loki from hostb:14:44:15.724200 IP 192.168.200.3 > 192.168.200.1: ICMP echo request, id 21253, seq 4, length 6414:44:15.724207 IP 192.168.200.1 > 192.168.200.3: ICMP echo reply, id 21253, seq 4, length 64If I ping router from loki, all is fine:15:04:55.637839 IP 10.0.0.2 > 10.0.0.1: ICMP echo request, id 46852, seq 3, length 6415:04:55.638324 IP 10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46852, seq 3, length 64Any ideas how to find the reply?
Unable to figure out how to route a packet through a multi-homed nic
networking;freebsd;routing;tcp ip
Why are LOKI and HOST_A connected by a router when they are on the same subnet?  Is it really a router, or is it just a switch?  (From your later comments, although the device is a router, it is just acting as a switch between LOKI and HOST_A).What is the routing table on HOST_A and ROUTER?  If it were to try to reach 192.168.200.1, why should it use LOKI as a destination?Unless the routing table on these devices know to use LOKI for the 192 subnet, they will just forward to the default gateway.As an alternative, you might want to investigate installing NAT on LOKI.  For many services, it can encapsulate traffic from HOST_B as traffic from LOKI.  Since other machines can get to there, it can receive the traffic and forward back to HOST_B.