I have a pretty standard setup at home, which consists of a single subnet 192.168.240.0/24, and my DSL router sits on 192.168.240.1. Other devices occupy 192.168.240.64 onwards.
But I've now added a Linux server on 192.168.240.16, which has two NICs. One obviously sat on 192.168.240.0/24 and another sitting on 192.168.241.0/24 (192.168.241.16).
At the moment, there is nothing else on 192.168.241.0/24, but I intend to move my DSL modem onto this subnet in the near future.
I'm trying to get routing configured on the Linux box between the two interfaces, and I believe I have that working. But before I move the DSL modem, I thought I'd make sure that routing was working.
I checked the routing table on the Mac (using netstat -r) before I did anything, which (minus irrelevant entries) showed as:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.240.1 UGSc 4665 0 en0
192.168.240 link#4 UCS 8 0 en0
So I then configured a static route on the Mac as follows:
route add -net 192.168.241.0/24 192.168.240.16
Then the routing table on the Mac showed:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.240.1 UGSc 4665 0 en0
192.168.240 link#4 UCS 8 0 en0
192.168.241 192.168.240.16 UGSc 0 1 en0
When I then attempted to ping the second interface on my Linux box from the Mac, I received no reply. Checking the routing tables again, to my amazement, an extra line appeared.
Destination Gateway Flags Refs Use Netif Expire
default 192.168.240.1 UGSc 4665 0 en0
192.168.240 link#4 UCS 8 0 en0
192.168.241 192.168.240.16 UGSc 0 1 en0
192.168.241.16 192.168.240.1 UGHDI 0 17 en0
Why did this last line appear, and why did it not honour the route I'd created previously? What do I need to do to force it to use the static route I've created?
