FS#18700 - [netcfg] add static routes support
Attached to Project:
Arch Linux
Opened by Olivier Mehani (shtrom) - Tuesday, 16 March 2010, 03:09 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Sunday, 29 May 2011, 07:40 GMT
Opened by Olivier Mehani (shtrom) - Tuesday, 16 March 2010, 03:09 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Sunday, 29 May 2011, 07:40 GMT
|
Details
It may be useful to be able to define static routes within
netcfg.
Considering the migration to iproute2, the additional syntax could be as simple as ROUTES=("192.168.1.0/24 via 192.168.0.1" "192.168.2.0/24 via 192.168.0.2") which would translate as commands ip route add 192.168.1.0/24 via 192.168.0.1 dev $INTERFACE ip route add 192.168.2.0/24 via 192.168.0.2 dev $INTERFACE (This assumes that network 192.168.0.0/24 is reachable via $INTERFACE, which is currently being configured) Similarly for IPv6 (see ROUTES=("2001:DB8:1::/64 via 2001:DB8:1::1") would translate to ip -6 route add 2001:DB8:1::/64 via 2001:DB8:1::1 dev $INTERFACE |
This task depends upon
Closed by Rémy Oudompheng (remyoudompheng)
Sunday, 29 May 2011, 07:40 GMT
Reason for closing: Implemented
Additional comments about closing: Merged in git except that it will only happen if IP='static'
Sunday, 29 May 2011, 07:40 GMT
Reason for closing: Implemented
Additional comments about closing: Merged in git except that it will only happen if IP='static'
ROUTES=("2001:DB8:1::/64 via 2001:DB8:1::1")
I meant
ROUTES6=...
for coherence.
This patch adds netcfg configuration option "ROUTES" to setup static routes. This is done
regardless of whether the IP address is configured using a DHCP or statically.
ROUTES is an array containing entries of the form "DESTINATION[/NETMASK] [via
ROUTER]" which are directly used in an “ip route add” command.
Then, the IPv6 version. I realise after looking at the code that this could have been done using the IPCFG (and IP6CFG from
FS#18699) parameter, and this proposal is just a generalisation of the GATEWAY parameter. Anyway, here is the code.Please excuse me for the mess with the order of the patches.
0003-Support-for-IPv6-static-... (1.2 KiB)