0

I have Pidora (Fedora on a Raspberry Pi) that is currently acting as a Ethernet to WiFi "bridge".

I have dhcpd configured to hand out IPs in the range of 10.0.2.25 - 10.0.2.30, netmask is 255.255.0.0. This is configured against my Ethernet interface which has an IP of 10.0.2.1, which is the same as the dhcp router option.

I can see through arp that IPs are being handed out to devices.

I also has a wireless connection to my wireless router and I have configure it to obtain an address statically. The address is 10.0.1.55

I have changed the ipv4 to forward traffic and I have also used the following iptables to forward the traffic:

sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE  
sudo iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT  
sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT  

I can now plug in any device to the Pis ethernet obtain an IP and connect to the outside internet via my wifi.

I can't however seem to ping (or do anything) to addresses on the ethernet interface. For example if I plug another computer into the ethernet and it gets assigned an address of say 10.0.2.27 I can't ping form a device connected to my wireless that has an address like 10.0.1.10

Any help is greatly appreciated. :-)

  • 1
    you may simply use the network-manager to edit the ethernet connection , in ipv4 tab just change the "method" to "shared to other computers", – Jonah May 21 '17 at 22:11
  • the network-manager will automatically chose the better settings for you , also Note that dhcp server should be disabled in the bridgedRouter in order to have a working shared connection! – Jonah May 21 '17 at 22:22
  • Your wireless device needs to know that address 10.0.2.27 is beyond the pi gateway address 10.0.1.55. So it needs something like ip route add 10.0.2.0/16 via 10.0.1.55. Also, ping uses protocol icmp so you need an explicit iptables -A FORWARD -p icmp -j ACCEPT. Or if you have a secure network change the default policy from DROP to ACCEPT. – meuh May 22 '17 at 9:22
  • You are masquerading traffic, you are not bridging it. So wlan and ethernet must be different segments. Assuming that your WLAN segment is a /24, you need 255.255.255.0 netmasks on both, then 10.0.2.0/24 on ethernet and 10.0.1.0/24 on WLAN will be separate. – dirkt May 22 '17 at 9:37
  • Thanks for the comments so far. I am masquerading the traffic in order to grant devices connected via ethernet access to the wider world via the wireless adapter that gets an IP address from my home router. What I really want to do is have a network on eth0 and get an IP on wlan0 (from my home router) and be able to access any device connected to the eth0 whilst having this device be able to connect to the internet. Is this possible? – J.Evs May 22 '17 at 21:53
0

I would like to thank everyone for their comments and putting me on the right path.

In the end I have logged onto my router and updated the routing section giving it the IP range I want to reach and the range of IP addresses that may be assigned to devices on that network.

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.