1

is it possible to use two Raspberry Pi (4, 1 GB) with only one USB LTE dongle? How to configure it? USB dongle is connected to USB port of selected Raspberry Pi. The second one I'd connect using ethernet port.

EDIT: WiFi to share connection is more comfortable but I prefer easier solution (ethernet or WiFi). Current connection details (Raspberry Pi #2 is not connected now):

ip addr show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether dc:a6:32:05:32:c8 brd ff:ff:ff:ff:ff:ff
3: wlan0:  mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether dc:a6:32:05:32:c9 brd ff:ff:ff:ff:ff:ff
4: enx0c5b8f279a64:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.100/24 brd 192.168.8.255 scope global noprefixroute enx0c5b8f279a64
       valid_lft forever preferred_lft forever
    inet6 fe80::d661:d504:c3e5:d5a4/64 scope link 
       valid_lft forever preferred_lft forever
lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 12d1:14dc Huawei Technologies Co., Ltd. E33372 LTE/UMTS/GSM HiLink Modem/Networkcard
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • Should be possible assuming you are looking just to share internet - could you add details of which LTE dongle you have and how it currently works (network details)? Are you fixed on Ethernet connection - is WiFi also possible? – Andyroo Apr 20 at 10:37
  • @Andyroo, question text updated. – Anton Apr 20 at 10:46
2

If you only want to connect these two RasPis, then the simplest solution is to use the wired ethernet connection with just two static ip addresses. I assume interface enx0c5b8f279a64 on RasPi1 is that one from the USB LTE dongle. Now give its eth0 interface a static ip address, maybe 192.168.1.1/24. It must be different from the subnet 192.168.8.0/24 the USB dongle is in. Enable ip forwarding in /etc/sysctl.conf by uncommenting the line and reboot:

net.ipv4.ip_forward=1

On RasPi2 give its eth0 interface an ip address from the same subnet of eth0 on RasPi1, e.g. 192.168.1.2/24. Then you have to set a static route to the USB dongle on RasPi1 with:

rpi2 ~$ sudo ip route add default via 192.168.1.1 dev eth0

If using default dhcpcd networking then you can set this persistent in /etc/dhcpcd.conf with option static routers=. Just use the example given there and reboot:

# Example static IP configuration:
interface eth0
static ip_address=192.168.1.2/24
static routers=192.168.1.1
static domain_name_servers=1.1.1.1 8.8.8.8
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.