[OpenIndiana-discuss] multiple IP addresses, same NIC
Edward Ned Harvey (openindiana)
openindiana at nedharvey.com
Wed Mar 6 00:38:07 UTC 2013
All subnets have been renamed to protect the innocent. ;-)
At home, I use 192.168.1.x /24, and unfortunately, I need to VPN to work where they use both 192.168.1.x /24 and 192.168.10.x /24. Fortunately, I don't need to access any of the 192.168.1.x machines at work; I only need to access 192.168.10.x. So I invented a new network at home, 192.168.2.x /24. My firewall has 192.168.1.1 and also 192.168.2.1 on the same LAN NIC. My OI box has 192.168.1.100 and also 192.168.2.100 (again, two separate subnets on the same NIC). My Windows VM has 192.168.1.101 and also 192.168.2.101. For both my OI and Windows boxes, the default GW is 192.168.1.1. And for both machines, I added a static route, 192.168.10.x via 192.168.2.1. Both OI and Windows can ping 192.168.2.1, and 192.168.1.1, and everything on both the local LANs, and the internet.
On my windows box, ping 192.168.10.x is also fine, meaning on windows, everything is fine.
On my OI box... Despite successfully doing everything else, I still can't reach 192.168.10.x. Thanks to wireshark, I can see what's happening:
When I ping 192.168.2.1, I look at the packet capture, and I can see source IP address 192.168.2.100, destination MAC address belongs to 192.168.2.1. This is perfect. ping 192.168.2.1 works perfectly. And also ping internet, and LAN, but the problem is ...
When I try to ping 192.168.10.x, I see the packet go out my OI network interface, source IP address 192.168.1.100 (which is wrong) route via the MAC address of 192.168.2.1 (which is right). The source IP and the router IP are not in the same subnet with each other, but because they're on the same physical wire with no VLAN separation, the packet actually reaches the router. Which is then, of course, confused and unable to route the packet. The desired behavior is to send *from* 192.168.2.100 and route via 192.168.2.1. Apparently, the OI system gets confused because both subnets are on the same NIC.
I can't see any reason why the system would correctly use 192.168.2.100 as the source IP when I'm pinging 192.168.2.1, but then use a different source IP when I'm pinging something that gets routed via 192.168.2.1
Anybody have any pearls of wisdom for me here? Any other info I could provide, such as the routing tables, or the commands I used to configure the IP's and routes?
Thanks, if you know anything....
More information about the OpenIndiana-discuss
mailing list