mirror of
https://github.com/femtofox/femtofox.git
synced 2026-12-01 12:26:39 -05:00
Fixed routes to update automatically
When swapping eth0 and wlan0 different ways the default route wasn't updating. This fixes it.
This commit is contained in:
parent
a7ace1c758
commit
f8f2a9cb82
1 changed files with 9 additions and 1 deletions
|
|
@ -1,4 +1,3 @@
|
|||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
||||
# Include files from /etc/network/interfaces.d:
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
|
|
@ -8,4 +7,13 @@ iface lo inet loopback
|
|||
allow-hotplug wlan0
|
||||
iface wlan0 inet dhcp
|
||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
metric 100
|
||||
post-up sleep 5 && dhclient wlan0
|
||||
pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev wlan0 metric 100
|
||||
|
||||
|
||||
allow-hotplug eth0
|
||||
iface eth0 inet dhcp
|
||||
metric 10
|
||||
post-up ip route replace default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10
|
||||
pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue