1

I am fairly green to the networking game but I will try to explain the best I can. I am using a Raspberry Pi 3. I have dnsmasq and hostapd to create a wireless access point. I was successful in doing so as well as port forwarding the internet from ETH0.

However, directions have changed.

What I want to accomplish is to continue utilizing my RPI as a wireless access point yet without internet access. What I would like to achieve is to have a wireless access point that hands out IPs (dhcp server) as well as an Ethernet (access point?) static network that hands out IPs (dhcp server) if requested.

I would like to have a setup like... rpi_eth0->static IP = 192.168.1.3 rpi_wlan0-> static IP = 196.168.1.4

Computer A can connect over Ethernet to PI and acquire an IP (ex. 192.168.1.91)

Computer B can connect over WiFi to PI and acquire an IP (ex. 192.168.1.127)

Both computers can ping each other. Both computers can ping the PI. PI can ping both computers.

Is there a tutorial out there specific to what I am trying to achieve? The only ones I have seen are specific to forwarding the incoming internet around.

asked Jul 27, 2016 at 12:45
7
  • So basically making a router with DHCP? Commented Jul 27, 2016 at 12:50
  • Essentially, yes. The only differences would be...No incoming internet WAN. Only one LAN port (the Phy on the PI (whoah)). The PI, ultimately would serve as a DHCP service for both the WLAN network and the ETH network and could route traffic between computers/devices attached to each end. Commented Jul 27, 2016 at 13:19
  • Ahhh, I get you. However, how will they access the internet?The devices are just on the PI LAN with no connection to the outside at all?? Commented Jul 27, 2016 at 13:40
  • That is correct. They do not need to access the internet; they only need to access one another. I would like to be able to connect one->to many devices on a private LAN either wirelessly or wired. Commented Jul 27, 2016 at 13:43
  • Take a look at this: raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router. It is exactly what you need, it tells you how to set it up as a router and how to set it up with DHCP. Not sure if you can have multiple interfaces like ETH0 or WLAN0 giving out IP's but maybe you can. Give it a try? Commented Jul 27, 2016 at 13:56

1 Answer 1

1

if you want dnsmasq to serve IP addresses from the same subnet to different interfaces you can edit the interfaces declaration in the dnsmasq.conf look under interfaces in the man page here. There is also another way I would recommend doing over the dnsmasq method. You can simply bridge the WLAN and LAN in your interfaces conf and then set the bridge name as the interface value in the dnsmasq.conf. This way both interfaces are bridged in networking and dnsmasq leases to any interface in the bridge. Hope this helps!

answered Jul 27, 2016 at 14:19
4
  • To follow that up then... I would still enable ipv4 forwarding? Would I have to have two sets of the following entries into the IPTABLES that route the interfaces to bridge? sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT Commented Jul 27, 2016 at 14:25
  • @BenLemond you will need rules to forward traffic between the two interfaces see this guide for info on a configuration similar to yours Commented Jul 27, 2016 at 17:12
  • Here is another reference for your configuration www.linux.com Commented Jul 27, 2016 at 17:20
  • I think I've got it operating now. My WLAN0 supplies dhcp and is routed to and from my ETH0. ETH0 is static and can communicate with any static device hanging off of the network. WLAN0 devices can also communicate to any static ethernet devices hanging off of the network. The static devices hanging off of the network can communicate to the RPI via the RPIs ethernet network (192.168.1.1), however the static devices cannot communicate to the WLAN0 devices via their IP addresses (10.10.10.1...etc.). This has got to be a routing issue from ETH0 back up, yes? Commented Jul 27, 2016 at 20:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.