On 2017-04-19 12:46, Florian Gamböck wrote:
On 2017-04-18 20:41, Mick wrote:
(...)
Something like this should work:
# Define the gateway you want to configure
gateways_eth0="192.168.0.254,AA:BB:CC:DD:EE:FF,192.168.0.10"
# Define the default route for gateway 192.168.0.254
routes_192168000254_AABBCCDDEEFF="default via 192.168.0.254"
# Define the IP and netmask when using gateway 192.168.0.254
config_192168000254_AABBCCDDEEFF="192.168.0.10/24"
# Define the DNS servers to use with gateway
dns_servers_192168000254_AABBCCDDEEFF="192.168.0.254"
# Then you need to add a line for all other routers the Raspi may
connect to: fallback_eth0="dhcp"
(...)
(...)
I'll try it the next days and report back afterwards!
That was really a great advice, a big thank you again! It works as
expected.
Just a few notes for future reference:
config_eth0="arping" was necessary for this module to load and for the
gateways_* variables to be parsed.
I needed to emerge net-misc/iputils with "arping" USE flag. The
net-analyzer/arping package is *not* sufficient, because it doesn't work
with the spoofing address in the gateway variable.
Another side-note: If I am connected to another network, so DHCP is
used, and I change networks, as in "lose connection from the network and
re-connecting with my home network", then the above configs are *not*
used, DHCP is used. But this might be a bug in netifrc or a missing hook
in my configs. I'll look more into it and start another thread or even a
bug report if I'm not able to solve it.
--
Kind regards
Flo