Sample Header Ad - 728x90

How can I share LTE modem internet over Wifi?

1 vote
2 answers
161 views
I've got my LTE modem setup with NetworkManager/ModemManager and that's working fine. I've also got Wifi setup as an access point in NetworkManager with DHCP. But how can I share the LTE modem internet access over Wifi? I've enabled IP forwarding (echo 1 > /proc/sys/net/ipv4/ip_forward), what else is there? # ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:12946 errors:0 dropped:0 overruns:0 frame:0 TX packets:12946 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1297231 (1.2 MiB) TX bytes:1297231 (1.2 MiB) wlan0 Link encap:Ethernet HWaddr E8:4F:25:DD:BD:51 inet addr:10.42.0.1 Bcast:10.42.0.255 Mask:255.255.255.0 inet6 addr: fe80::ea4f:25ff:fedd:bd51/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:77 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:12101 (11.8 KiB) wwan0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:100.72.254.176 P-t-P:100.72.254.176 Mask:255.255.255.224 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:1808 errors:0 dropped:0 overruns:0 frame:0 TX packets:2176 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:356293 (347.9 KiB) TX bytes:261384 (255.2 KiB) # ip route default via 100.72.254.177 dev wwan0 metric 700 10.42.0.0/24 dev wlan0 scope link src 10.42.0.1 metric 600 100.72.254.160/27 dev wwan0 scope link src 100.72.254.176 metric 700 The DHCP for the Wifi is done by NetworkManager starting dnsmasq with default parameters: # ps -eF | grep dnsmasq nobody 1104 606 0 1285 2444 0 09:05 ? 00:00:00 /usr/bin/dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.42.0.1 --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-lease-max=50 --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlan0.leases --pid-file=/var/run/nm-dnsmasq-wlan0.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d ref https://unix.stackexchange.com/questions/384762/networkmanager-and-dnsmasq-dhcp-address-range) . # cat /etc/NetworkManager/system-connections/ap.nmconnection [connection] id=ap uuid=3205b229-8c4d-4766-8d63-bcd949d03321 type=wifi autoconnect=false interface-name=wlan0 [wifi] band=bg channel=1 mode=ap ssid=MySSID [wifi-security] group=ccmp; key-mgmt=wpa-psk pairwise=ccmp; proto=rsn; psk=MyPSK [ipv4] method=shared [ipv6] addr-gen-mode=stable-privacy method=ignore [proxy] A colleague suggested https://github.com/oblique/create_ap . I tried both the NAT and bridge options but they both failed. NAT: # create_ap -w 2 wlan0 wwan0 APTest 12345678 WARN: brmfmac driver doesn't work properly with virtual interfaces and it can cause kernel panic. For this reason we disallow virtual interfaces for your adapter. For more info: https://github.com/oblique/create_ap/issues/203 WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt Config dir: /tmp/create_ap.wlan0.conf.XX59Vdf8 PID: 537195 Network Manager found, set wlan0 as unmanaged device... [46988.754925] ieee80211 phy1: brcmf_set_pmk: failed to change PSK in firmware (len=0) [46988.784848] ieee80211 phy1: brcmf_vif_set_mgmt_ie: vndr ie set error : -52 [46988.792027] ieee80211 phy1: brcmf_vif_set_mgmt_ie: vndr ie set error : -52 DONE Sharing Internet using method: nat iptables v1.8.7 (legacy): unknown option "--to-ports" Try `iptables -h' or 'iptables --help' for more information. Doing cleanup.. done Bridge: # create_ap -w 2 -m bridge wlan0 wwan0 APTest 12345678 WARN: brmfmac driver doesn't work properly with virtual interfaces and it can cause kernel panic. For this reason we disallow virtual interfaces for your adapter. For more info: https://github.com/oblique/create_ap/issues/203 WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt Config dir: /tmp/create_ap.wlan0.conf.XXgGPNON PID: 540585 Network Manager found, set wlan0 as unmanaged device... DONE Sharing Internet using method: bridge Create a bridge interface... ip: RTNETLINK answers: Operation not supported
Asked by parsley72 (319 rep)
Jul 22, 2024, 04:18 AM
Last activity: Jul 31, 2024, 11:02 PM