0

I have established a hotspot via hostapd that is using a SIM network (through datacall), and I can connect to the network from my phone but I can't browse anything. My suspicion is the packets requested from the station aren't being correctly serviced but I'm not fully aware of the entire picture.

Interestingly, I can ping to google.com for instance from the linux shell where hostapd is running

Here's how I set up a hostapd:

modprobe <wifi-driver.ko>
iw dev wlan0 set type __ap
ifconfig wlan0 up
brctl addif bridge0 wlan0
hostapd -dd hostapd.conf

Also a follow up question: the connection from the station doesn't happen when wlan0 isn't added to the bridge.

Output of ifconfig:

bridge0   Link encap:Ethernet  HWaddr 0e:7d:2a:ce:86:e0  
          inet addr:192.168.225.1  Bcast:192.168.225.255  Mask:255.255.255.0
          inet6 addr: fe80::c7d:2aff:fece:86e0/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:933 errors:0 dropped:0 overruns:0 frame:0
          TX packets:549 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:288140 (281.3 KiB)  TX bytes:79139 (77.2 KiB)

eth0      Link encap:Ethernet  HWaddr 00:55:7b:b5:7d:f7  
          inet addr:169.254.4.1  Bcast:169.254.4.255  Mask:255.255.255.0
          inet6 addr: fe80::255:7bff:feb5:7df7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:963 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:303266 (296.1 KiB)
          Interrupt:75 

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:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:1840 (1.7 KiB)  TX bytes:1840 (1.7 KiB)

rmnet_data0 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:25.24.48.170  Mask:255.255.255.252
          UP RUNNING  MTU:1460  Metric:1
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9480 (9.2 KiB)  TX bytes:20389 (19.9 KiB)

rmnet_data1 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:25.19.213.156  Mask:255.255.255.248
          UP RUNNING  MTU:1460  Metric:1
          RX packets:278 errors:0 dropped:0 overruns:0 frame:0
          TX packets:331 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:51353 (50.1 KiB)  TX bytes:151692 (148.1 KiB)

rmnet_ipa0 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING  MTU:2000  Metric:1
          RX packets:209 errors:0 dropped:0 overruns:0 frame:0
          TX packets:379 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:62153 (60.6 KiB)  TX bytes:173597 (169.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:03:7f:61:a0:41  
          inet6 addr: fe80::203:7fff:fe61:a041/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:548 errors:0 dropped:9 overruns:0 carrier:0
          collisions:0 txqueuelen:3000 
          RX bytes:327093 (319.4 KiB)  TX bytes:87133 (85.0 KiB)
8
  • What instructions are you following? You can't just bridge from Wi-Fi to cellular data. You need to set up NAT (e.g. iptables). You probably also want a DHCP server to configure wireless clients, unless you're manually giving them static IPs on the private subnet.
    – Spiff
    Feb 9, 2021 at 3:46
  • so basically we have a proprietary app that establishes a data call (along with some other IP stuff which I'm currently unaware of), and then I connect to the hotspot from my phone. By setting up NAT, you're referring to setting up packet forwarding to wlan0? The generic idea is when STA tries to load up google.com, it sends a request over to wlan0 but the interface itself doesn't recognize the request hence no response sent back to the STA?
    – xyf
    Feb 10, 2021 at 0:48
  • also, do you see why am I only able to connect to the hotspot when wlan0 is added to bridge0?
    – xyf
    Feb 10, 2021 at 0:59
  • By default, your computer will not forward traffic between interfaces. Setting wlan0 into AP mode and running hostapd does not change this fact. All it does is allows wireless client stations to connect to your Linux box. It doesn't help them get IP addresses, and it doesn't route their traffic out rmnet_data0/1. Adding wlan0 to bridge0 doesn't solve those problems either. rmnet_data0/1 probably aren't the kind of interfaces that can be part of a bridge, because they're probably not Ethernet-like enough. Straight IP forwarding is not enough either.
    – Spiff
    Feb 10, 2021 at 7:09
  • (continued) You need to run a Network Address Translator (NAT) so that any packet that comes in wlan0/bridge0 and needs to go out rmnet_data0/1 gets its IP source address rewritten from your private 192.168.x.x/16 subnet to your public IP address, like 25.19.213.156. Otherwise, your "SIM network" (as you call it) won't accept the traffic, because that network only expects to see traffic from 25.19.213.156, not 192.168.225.1 or whatever.
    – Spiff
    Feb 10, 2021 at 7:16

0

You must log in to answer this question.

Browse other questions tagged .