real IP and rfc1918 IP on the same machine - how?

Matthew Hardcastle geek at doomgeek.com
Sun Jan 25 17:51:53 UTC 2015


> On Jan 25, 2015, at 9:50 AM, freebsd-lists at potato.growveg.org wrote:
> 
> Ah sorry I've probably worded it wrongly. 
> 
> em0 = wired interface = real ip on a /28 = 255.255.255.240 netmask
> ath0 = wireless interface = 192.168.100.100 netmask 255.255.255.0
> 
> Something just occurred to me. If the default route i.e. 0.0.0.0/0 -> my 
> real router ip then how am I going to exclude 192.168.100.0/24 ?
> -- 
> John 

You don’t need to do anything other than assign the IP and subnet to your wireless interface to exclude it from the default route. Your computer decides which interface it will send a packet out of based on the most specific route for that packet it can find in the routing table. For example, If you have a packet destined for 192.168.100.1 your computer will choose your wireless interface because the packet matches 192.168.100.0/24 more specifically that it matches 0.0.0.0/0.

Double checking your routing table (by running `netstat -rn`) and your interface configuration (by running `ifconfig` and `grep ^ifconfig /etc/rc.conf`) will allow us to make sure you’re interfaces are actually configured as your expect they are.

Matt


More information about the freebsd-questions mailing list