1

I have an RPi that is NOT connected to the internet and has some data.

This RPi has WiFi and I want some devices to connect to it via WiFi to access some data.

I have achieved this already, here's my network/interfaces file

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

And my dhcpd.conf file looks like

subnet 192.168.42.0 netmask 255.255.255.0 {
  range 192.168.42.10 192.168.42.50;
  option broadcast-address 192.168.42.255;
  option routers 192.168.42.1;
  default-lease-time 600;
  max-lease-time 7200;
  option domain-name "local";
  option domain-name-servers 8.8.8.8, 8.8.4.4;
}

What I'm trying to do now is allow devices to connect to this WiFi network but at the same time connect to the internet via 3G/4G. I'm mainly focusing on iOS at the moment.

I've seen some networks on trains, bars... that do this on an iPhone the network shows the message No internet connection. This allows me to connect to the network and at the same time use my cellular data. Looking at the WiFi settings I see that instead of the DHCP tab, the Static tab is selected and only with the IP address and the Subnet Mask.

So the question is, is there a setting on dhcpd.conf, network/interfaces... that would allow me to achieve this?

3

Your dhcpd.conf has this option routers 192.168.42.1 line. In human language that line tells to the clients:

If you need to reach computers outside of the 192.168.42.X network, simply send your IP packets to this address and it will route them to destination.

Removing this option should prevent the clients from trying to reach the Internet via your RPi and use whatever alternative connection they have available.

  • 1
    I'd also remove option domain-name-servers 8.8.8.8, 8.8.4.4; as I believe it will attempt to use these for a lookup, but have no way of getting to them (as you will have removed the option routers) so will fail, but it may take time... – KennetRunner Sep 22 '16 at 12:14
  • 1
    Removing them won't harm of course. I'd expect this option to simply be ignored since without routers there's no way to reach those addresses anyway. – Dmitry Grigoryev Sep 22 '16 at 12:15

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.