My 11.0-RELEASE-p9 machine has three network interface cards, two wired and one wireless; these are re0, nfe0, and ral0/wlan0, respectively. The machine's primary role is an Internet gateway for the home LAN. The LAN is on re0. Both nfe0 and wlan0 get DHCP addresses from two separate Internet Service Providers (ISP). nfe0 is the default gateway.
I would like to set up some static routes so that traffic going to a few specific destination IP addresses will go through the wlan0 gateway. For example, let's say all traffic sent to 8.8.8.8 needs to go through the wlan0 gateway. If wlan0 had a fixed address like 172.16.0.1, then something like this might work -
I've tried -
Any ideas?
EDIT: There is a fundamental misunderstanding/confusion in this question; it gets resolved in the solution.
I would like to set up some static routes so that traffic going to a few specific destination IP addresses will go through the wlan0 gateway. For example, let's say all traffic sent to 8.8.8.8 needs to go through the wlan0 gateway. If wlan0 had a fixed address like 172.16.0.1, then something like this might work -
route add -host 8.8.8.8 172.16.0.1
- but wlan0 does not have a fixed address.I've tried -
route add -host 8.8.8.8 -interface wlan0
- but that doesn't treat wlan0 as a gateway device, rather, I think wlan0 is treated as the final destination in this case.Any ideas?
EDIT: There is a fundamental misunderstanding/confusion in this question; it gets resolved in the solution.