0

I would like to setup my Ubuntu Server to create a wifi network to which people can connect and open local webpages. The created wifi network must not provide access to the internet and should only allow the access to local webpages.

However, it is necessarry that the ubuntu server, which runs on a raspberry pi, has access to the internet.

This graphical illustration clarifies my requirements:

                                 |
                 wifi            |           wired            wan
mobile-phone <~.~.~.~.~> (wlan0)RPi(eth0) <---------> router <---> INTERNET
            \             /      |     \             /
           (dhcp)   192.168.4.1  |    (dhcp)   192.168.50.1

I don't have the slightest idea how I could achieve this and would be incredbily thankful for any help/tutorial I get.

My System Information / Hardware Specs:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

ubuntu
    description: Computer
    product: Raspberry Pi 3 Model B Plus Rev 1.3
    serial: 000000006d462490
    width: 64 bits
    capabilities: smp cp15_barrier setend swp
  *-core
       description: Motherboard
       physical id: 0
     *-cpu:0
          description: CPU
          product: cpu
          physical id: 0
          bus info: cpu@0
          size: 1400MHz
          capacity: 1400MHz
          capabilities: fp asimd evtstrm crc32 cpuid cpufreq
     *-cpu:1
          description: CPU
          product: cpu
          physical id: 1
          bus info: cpu@1
          size: 1400MHz
          capacity: 1400MHz
          capabilities: fp asimd evtstrm crc32 cpuid cpufreq
     *-cpu:2
          description: CPU
          product: cpu
          physical id: 2
          bus info: cpu@2
          size: 1400MHz
          capacity: 1400MHz
          capabilities: fp asimd evtstrm crc32 cpuid cpufreq
     *-cpu:3
          description: CPU
          product: cpu
          physical id: 3
          bus info: cpu@3
          size: 1400MHz
          capacity: 1400MHz
          capabilities: fp asimd evtstrm crc32 cpuid cpufreq
     *-memory
          description: System memory
          physical id: 4
          size: 912MiB
  *-usbhost
       product: DWC OTG Controller
       vendor: Linux 4.15.0-1041-raspi2 dwc_otg_hcd
       physical id: 1
       bus info: usb@1
       logical name: usb1
       version: 4.15
       capabilities: usb-2.00
       configuration: driver=hub slots=1 speed=480Mbit/s
     *-usb
          description: USB hub
          product: USB 2.0 Hub
          vendor: Standard Microsystems Corp.
          physical id: 1
          bus info: usb@1:1
          version: b.b3
          capabilities: usb-2.00
          configuration: driver=hub maxpower=2mA slots=4 speed=480Mbit/s
        *-usb:0
             description: USB hub
             product: USB 2.0 Hub
             vendor: Standard Microsystems Corp.
             physical id: 1
             bus info: usb@1:1.1
             version: b.b3
             capabilities: usb-2.00
             configuration: driver=hub maxpower=2mA slots=3 speed=480Mbit/s
           *-usb
                description: Generic USB device
                vendor: Standard Microsystems Corp.
                physical id: 1
                bus info: usb@1:1.1.1
                version: 3.00
                capabilities: usb-2.10
                configuration: driver=lan78xx maxpower=2mA speed=480Mbit/s
        *-usb:1
             description: Keyboard
             product: USB Receiver
             vendor: Logitech
             physical id: 2
             bus info: usb@1:1.2
             version: 29.01
             capabilities: usb-2.00
             configuration: driver=usbhid maxpower=98mA speed=12Mbit/s
        *-usb:2
             description: Keyboard
             product: 2.4G Keyboard Mouse
             vendor: MOSART Semi.
             physical id: 3
             bus info: usb@1:1.3
             version: 81.13
             capabilities: usb-1.10
             configuration: driver=usbhid maxpower=100mA speed=12Mbit/s
  *-network:0 DISABLED
       description: Wireless interface
       physical id: 2
       logical name: wlan0
       serial: b8:27:eb:13:71:c5
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=brcmfmac driverversion=7.45.18 firmware=01-6a2c8ad4 multicast=yes wireless=IEEE 802.11
  *-network:1
       description: Ethernet interface
       physical id: 3
       logical name: eth0
       serial: b8:27:eb:46:24:90
       size: 1Gbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=lan78xx driverversion=1.0.6 duplex=full ip=10.0.0.92 link=yes multicast=yes port=MII speed=1Gbit/s

EDIT: I am using a snap to create the Access Point

I am now using the wifi-ap snap in order to create a wifi network. This works fine, however, I do not know how I can configure it the way I want it to (mentioned above).

Thanks for the help!

5
  • There is a snap for that.
    – Jos
    Sep 2, 2019 at 13:26
  • @Jos thanks for your comment. I have now managed to get my Access Point up and running - however, I can't configure the access point so that it does not grant internet access. Do you know what configuration variable I have to change so that it does not allow internet access if your're in the wifi? Thanks for your help! Sep 2, 2019 at 15:54
  • 1
    I would use two iptables rules for that. Packets coming in to the wlan0 interface should be dropped if their destination is anything but 192.168.*. On the other hand, packets coming in on the eth0 side destined for anything but the server itself should be dropped.
    – Jos
    Sep 2, 2019 at 17:49
  • @jos Those are not comments! They're answers! Please post one and I'll come back and upvote...
    – Fabby
    Sep 5, 2019 at 21:58
  • @Fabby well, allright. I don't use the snap I mentioned, I have no idea if it will run on a Raspberry Pi, and the iptables question ought to be a different post, but hey.
    – Jos
    Sep 6, 2019 at 8:05

1 Answer 1

1

There is a snap to do exactly that.

I don't know if the Access Point package can be configured to prevent your network clients from accessing the network. However, you can always create two iptables rules for that:

  1. a rule to drop packets coming in from the internet with destination other than the server IP;
  2. a rule to drop packets coming from the LAN destined for the internet, in other words, with a destination other than 192.168.*.
1
  • 1
    As promised! :-)
    – Fabby
    Sep 6, 2019 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .