Share Cellular Connection via Ethernet¶
This guide explains how to share a cellular connection via Ethernet on the Edge IoT Gateway M.
Configure NetworkManager Firewall Backend¶
Configure NetworkManager to use iptables as the firewall backend:
sudo install -d /etc/NetworkManager/conf.d
sudo tee /etc/NetworkManager/conf.d/99-firewall-backend.conf > /dev/null <<'EOF'
[main]
firewall-backend=iptables
EOF
Reboot the Gateway¶
Reboot the Gateway to apply the changes:
sudo reboot
Identify the Ethernet Interface¶
Edge IoT Gateway M has two Ethernet interfaces. Check which interface is connected to the device that should receive the shared Internet connection:
nmcli device status
The Ethernet interfaces are typically listed as eth0 and eth1.
The examples below use eth0. If you want to use eth1, replace
eth0 with eth1 in the commands below.
Configure Cellular and Ethernet Connections¶
Important
If you are connected to the Gateway over Ethernet, run all four commands below together. Enabling the shared Ethernet connection may interrupt your current connection to the Gateway.
Run the following commands:
sudo nmcli connection add type gsm ifname cdc-wdm0 con-name cellular apn internet
sudo nmcli connection up cellular
sudo nmcli connection add type ethernet ifname eth0 con-name shared ipv4.method shared ipv4.addresses 10.42.0.1/24
sudo nmcli connection up shared
Verify the Configuration¶
Check active NetworkManager connections:
nmcli connection show --active
Both the cellular and shared Ethernet connections should be active.
Check the IP address assigned to the Ethernet interface:
ip addr show eth0
The interface should use the following address:
10.42.0.1/24
Connect another device to the selected Ethernet port. The connected device
should automatically receive an IP address from the 10.42.0.0/24 network
and use the Gateway’s cellular connection to access the Internet.