NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Setting default route and specify interface to be used



On dic 12  1:07, Robert Elz wrote:
>
> From route(8) - the manual page for the route command ...
> 
>      In a change or add command where the destination and gateway are not
>      sufficient to specify the route the -ifp or -ifa modifiers may be used to
>      determine the interface or interface address.
> 
> Try that.

Thanks for highlighting it. I had tried some solutions from:

 https://mail-index.netbsd.org/netbsd-help/2006/12/15/0000.html

Adapting to my case `route add default -ifa <<ath0ip>> <<CCAip>>'
did not work, maybe because the `-ifa' modifier is related to the
WiFi NIC IP address; also, `route add -ifp ath0 -iface default
128.233.122.254' did not work, maybe due to the `-iface' modifier.

However, I tried now only with the modifier `-ifp':

route delete default
route add -ifp <interface> default <gateway_IP>
route change -ifp <interface> -net <network_address>

and it works. I had to explicitly delete and recreate the default
route, because otherwise apparently the ping to the gateway was
extraordinarily high (~150 ms). Now it is as expected (~1 ms).
The Ethernet NIC was also related to the network, so I had to change
it the same way (otherwise, the whole network, included the gateway,
was unreachable).

`dhcpcd' performed all these configuration by its own.
This way, instead, has the advantage of not running `dhcpcd' for
a static IP configuration, and I think it is more logical.

Thank you so much!

Rocky


Home | Main Index | Thread Index | Old Index