Network Configuration of a Raspberry Pi in LAN and WAN

Hi All! I would like to configure my Raspberry Pi in such a way that: 1. It is accessible (ping, etc.) by a machine B directly connected via Ethernet (local network but without going through a switch/router and without having to modify the configuration of machine B). 2. It always has access to the Internet via USB tethering (from a 4G-enabled phone). To achieve this, we tried changing the "metric" for wlan0 and eth0 in the routing table, in order to give priority to wlan0 and have it connect to the tethered connection. (Note that we conducted the tests with a Wi-Fi connection rather than USB tethering). However, we are unable to test if this configuration works because we cannot connect to the RPI via Ethernet due to the fact that the RPI's IP address on the local network (Machine B-RPI) is unknown to us. We attempted to fix it by modifying the dhcpcd.conf file, but without success; we are unable to ping the RPI via Ethernet. I would like to know if there is another solution to access the RPI via Ethernet (locally) while having it connected to 4G. Or do we necessarily need a router/switch to achieve this?
No description
No description
1 Reply
nour_oud
nour_oud6mo ago
Additional information: Model: Raspberry Pi 4B 2gb OS: Ubuntu Server 22.04.1 LTS (64-bit)