1

On my Raspberry PI 3 which runs Raspbian I have both Ethernet and Wifi. I need to configure interfaces so that Ethernet can be used for interanl network using switch and Wifi - for Internet connection via router.

For some reason my routing looks as follows and raspberry is trying to access everything outside via eth0 which has no connection to Internet:

default via 172.31.83.1 dev eth0 proto static 
default via 192.168.0.1 dev wlan0 proto dhcp src 192.168.0.100 metric 303  
169.254.0.0/16 dev eth0 scope link src 169.254.152.156 metric 202 
172.31.83.0/24 dev eth0 proto kernel scope link src 172.31.83.123 
172.31.83.0/24 via 172.31.83.1 dev eth0 proto static 
192.168.0.0/24 dev wlan0 proto dhcp scope link src 192.168.0.100 metric 303

I also used systemd to setup eth0 interface:

[Match]
Name=eth0

[Network]
Address=172.31.83.123/24
Gateway=172.31.83.1

[Route]
Destination=172.31.83.0/24
Gateway=172.31.83.1

[DHCP]
UseDNS=false

How can I configure my system so that eth0 is not treated as default and only wlan0 is used for internet connection?

Thank you

1 Answer 1

0

Just don't set Gateway under [Network]. Both that and the whole [Route] section are unnecessary.

P.S. Why even the [DHCP] section?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .