0

Setup: raspberry pi 4b as a client on eth0 interface: 80.33.1.2 , this lan has other clients but no gateway to the internet, no router to the internet in this address range. The lan is used to ssh back and forth between other lan clients and the pi. : also as a client on the wireless lan on wlan0 interface: this time as a dhcp client, the address is attributed by the wireless router which has a route to the wlan(internet). In occurrence, the pi is attributed as an address 10.42.0.215 by the router(10.42.0.1) which has a route to the internet.

Both (eth0 interface) and (wlan0 interface) work flawlessly when only one of both is up. (sudo ifconfig eth0 down/up and ditto for the lan). The wlan0 interface being up, and eth0 being down, allows for access to all lan clients in address range(10.42.0.0) AND access to the wlan(internet), addresses are resolved.

When eth0 and wlan0 are up both, addresses on both lan networks, the wlan0 served address range and the eth0 address range can then be accessed from and to the pi. (using ping, ssh, whatever). What is no longer possible is having the requests to wlan hosts (internet hosts as "https://wheather.com").

The configuration was not edited in between. What the wlan0 interface was capable of when eth0 interface being down, is no longer possible. exterior addresses(wlan alas internet) can no longer be resolved, and no longer be accessed using their ip.

The configuration as used and only, single file altered is the /etc/network/interfaces file. Here is the configuration as we used, again no other configuration files have been manipulated.

Intent: both eth0 and wlan0 interfaces up with the distinction that also exterior to the lan wlan clients(the internet) can be accessed from the pi.

Configuration of /etc/network/interfaces

auto eth0 allow -hotplug eth0 iface eth0 inet static address 80.33.1.2 netmask 255.255.255.0 broadcast 80.33.1.255 gateway 80.33.1.2

auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf address 10.42.0.215 netmask 255.255.255.0 broadcast 10.42.0.255 gateway 10.42.0.255

2
  • See How to set up networking/WiFi You should also tag with OS Also show output of ip a && ip r, but there is no point until you setup networking properly.
    – Milliways
    Dec 21 '21 at 22:51
  • wow ... I've never seen the static IP of an interface being used as the gateway address ... also, I've certainly never seen the broadcast address being used as the gateway address - and finally, I've never seen a public IPv4 subnet being used as a private network - any one of these three things could cause some interesting (and unwanted) side effects
    – Bravo
    Dec 22 '21 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.