I have 2 interfaces:
- wlan0: Connected to normal network with DHCP (has internet)
- eth0: Connected to LAN only. Used for PXE boot and NFS
The network-manager service is not installed on this machine.
If I leave /etc/network/interfaces totally blank, both interfaces come up OK but each has a default gateway set. I run ip route
:
default via 192.168.10.1 dev eth0 src 192.168.10.100 metric 202
default via 192.168.0.1 dev wlan0 src 192.168.0.20 metric 303
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.20 metric 303
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.100 metric 202
The default route on 192.168.10.1 is in the way of internet connectivity. If I run sudo route del default
and the ip route
again:
default via 192.168.0.1 dev wlan0 src 192.168.0.20 metric 303
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.20 metric 303
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.100 metric 202
Everything is good:
adam@sheep:~$ ping google.com
PING google.com (172.217.5.238) 56(84) bytes of data.
64 bytes from iad30s07-in-f238.1e100.net (172.217.5.238): icmp_seq=1 ttl=54 time=38.3 ms
64 bytes from iad30s07-in-f238.1e100.net (172.217.5.238): icmp_seq=2 ttl=54 time=38.7 ms
If I put anything at all in /etc/network/interfaces, wlan0 will not come up and the machine hangs at this boot step for about a minute: a start job is running for Raise network interfaces
. Even this fails:
auto wlan0
iface wlan0 inet dhcp
auto eth0
iface eth0 inet dhcp
- Am I missing something? Have I configured something incorrectly?
- How do I get that default route on eth0 to never be set in the first place?
I get the feeling the end solution looks something like this:
auto wlan0
iface wlan0 inet dhcp
auto eth0
iface eth0 inet dhcp
up route del default
but I'm currently stuck because even a more basic config fails.