joebloggs
Posts: 10
Joined: Wed Jun 06, 2012 10:21 pm

[SOLVED] RPI Hotspot broken in latest release? (it's not)

Tue Jul 02, 2013 9:21 am

Hi,

I've been trying to follow http://elinux.org/RPI-Wireless-Hotspot but it seems that the iptables rules aren't working, from peoples reports in the forum this is only the case on the latest release. ,

Does any one know of any changes between the feb and june releases that may impact this?

Kind Regards,

Jo
Last edited by joebloggs on Sat Jul 06, 2013 3:31 pm, edited 1 time in total.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: RPI Hotspot broken in latest release?

Tue Jul 02, 2013 5:32 pm

the way iptables works shouldn't change between releases.
Can you run iptables -t nat -L and iptables -L and paste the results ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

joebloggs
Posts: 10
Joined: Wed Jun 06, 2012 10:21 pm

Re: RPI Hotspot broken in latest release?

Wed Jul 03, 2013 10:29 pm

sudo iptables -t nat -L

Code: Select all

sudo iptables -t nat -L 
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere    
sudo iptables -L

Code: Select all

Chain INPUT (policy ACCEPT 756 packets, 76075 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  eth0   wlan0   anywhere             anywhere             state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  wlan0  eth0    anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 434 packets, 47667 bytes)
 pkts bytes target     prot opt in     out     source               destination         
Thanks for your help,

Jo

Thought I better add a bit more information - I followed the guide linked to in the first post.

The Pi now hosts an encrypted wifi network, using my laptop I can connect to that wifi network. I can login to the pi over ssh and from the pi can see the internet. But from my laptop, I don't have internet connectivity.

Could there be anything else that I've missed?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: RPI Hotspot broken in latest release?

Fri Jul 05, 2013 11:41 am

iptables looks fine.
can you ping IP addresses in the intarwebs from the laptop ?
Perhaps DNS lookup isn't working correctly
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

joebloggs
Posts: 10
Joined: Wed Jun 06, 2012 10:21 pm

Re: RPI Hotspot broken in latest release?

Sat Jul 06, 2013 2:16 pm

Nope, I can't ping internet IP addresses from the laptop.

I can ping (eg google.com) from the PI when logged into it over ssh from the laptop.

--Edit--

Ok, so I've looked at the routing information, and the difference between being connected to the pi vs. my home wifi is that when connected to the PI the doesnt seem to be a 'default' route in the routing table information which is displayed when I type 'route'.

So I'm going to try to find how to add a default route and and get it added on startup, I'll report back if I get it working.

-- 2nd Edit --

I've added a new default route on my laptop by typing: route add default gw 192.168.42.1 and now when pinging from my laptop I get a bit more, rather than saying "connect: Network is unreachable" immediately, it now seems to try and then gives me "ping: unknown host google.com"

If I ping an internet IP directly (I used an IP that I got from the ping of google.com from the pi) I simply don't get a reply

Code: Select all

PING 173.194.41.161 (173.194.41.161) 56(84) bytes of data.
^C
--- 173.194.41.161 ping statistics ---
57 packets transmitted, 0 received, 100% packet loss, time 56449ms

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: RPI Hotspot broken in latest release?

Sat Jul 06, 2013 2:59 pm

Can you paste the configuration for the DHCP server you're using ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

joebloggs
Posts: 10
Joined: Wed Jun 06, 2012 10:21 pm

Re: RPI Hotspot broken in latest release?

Sat Jul 06, 2013 3:16 pm

I'm using udhcpd as per the guide, my config file /etc/udhcpd.conf looks like this:

Code: Select all

start 192.168.42.2 # This is the range of IPs that the hostspot will give to cl$
end 192.168.42.20
interface wlan0 # The device uDHCP listens on.
remaining yes
opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
opt subnet 255.255.255.0
opt router 192.168.42.1 # The Pi's IP address on wlan0 which we will set up sho$
opt lease 864000 # 10 day DHCP lease time in seconds



Thanks for you help with this SirLagz, it is appreciated.

joebloggs
Posts: 10
Joined: Wed Jun 06, 2012 10:21 pm

Re: RPI Hotspot broken in latest release?

Sat Jul 06, 2013 3:30 pm

Ah! I've found it.

For some reason I commented out the driver line in /etc/hostapd/hostapd.conf

I'm not sure why i did that, maybe because I thought it was already working it didnt need it? Apparently it is quite important.

Thanks so much for your help SirLagz, but we can put this down to my mistake!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: [SOLVED] RPI Hotspot broken in latest release? (it's not

Sun Jul 07, 2013 1:20 pm

No problems ! :)
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Return to “Raspberry Pi OS”