geckus
Posts: 6
Joined: Thu May 30, 2013 2:46 am

Raspberry wireless headless unit with two wan interfaces

Mon Sep 28, 2015 3:35 pm

I have problems setting up my pi b+ with 2 wifi interfaces. So far the two wifi dongles are edimax. Managed to download fix to hostapd file.

One interface to connect as a client on wan0 to my home wifi , hence using network 192.168.0.0
Address 192.168.1.10
Netmask 255.255.255.0
Gateway 192.168.1.1
#so far connecting to home network seems pretty flawless.

2nd interface to broadcast as a AP on wan1 to mobile devices to access the pi
Via local
network 172.17.17.0
Address 172.17.17.10
Netmask 255.255.255.0

Hostapd and isc dhcp server installed, disabled dnsmasq as it seems to clash. But for some reason, when I connect to ap, my other computer gets kicked out of ssh to the pi.

I'm able to connect to the Internet when I ssh into the pi too.

The main idea is to connect a few pis(each will have a static ip 172.17.17.x) in a separate network with a switch.using a pi as a client to home wifi network. When there is no wifi signal. I should still be able to connect via AP to ssh.

Any help would be great.


geckus
Posts: 6
Joined: Thu May 30, 2013 2:46 am

Re: Raspberry wireless headless unit with two wan interfaces

Tue Sep 29, 2015 8:06 am

tested the whole thing and it corrected my previous problem.
but now i cannot ping the other pis in the network connected by switch.
eg. 172.17.17.202, 172.17.17.203 etc

geckus
Posts: 6
Joined: Thu May 30, 2013 2:46 am

Re: Raspberry wireless headless unit with two wan interfaces

Tue Sep 29, 2015 9:32 am

seems like all is good except that i cant get internet on the rest of my pis in the internal network. nor can i see the webpages when i enter in the AP. I can ping google from the pi router.and i can ping the rest of the pis.
intention was to get this going:
AP can access all the pis when there is no internet connection. anyone can help me the the forwarding commands.

I suspect its issues with iptables:
iptables -A FORWARD -p ALL -i eth0 -o wlan1 -j ACCEPT
iptables -A FORWARD -i wlan1 -o eth0 -m state --state ESTABLISHED,RELATE$
iptables -t nat -A POSTROUTING -o wlan1 -j SNAT --to-source 192.168.1.37

ifconfig:
eth0 Link encap:Ethernet HWaddr b8:27:eb:e2:69:cb
inet addr:172.17.17.201 Bcast:172.17.17.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:526 (526.0 B) TX bytes:17711 (17.2 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:31 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2692 (2.6 KiB) TX bytes:2692 (2.6 KiB)

wlan0 Link encap:Ethernet HWaddr 80:1f:02:ab:a2:45
inet addr:172.17.17.201 Bcast:172.17.17.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2634 errors:0 dropped:7 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:116089 (113.3 KiB) TX bytes:4485 (4.3 KiB)

wlan1 Link encap:Ethernet HWaddr 80:1f:02:ab:a2:62
inet addr:192.168.1.37 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3851 errors:0 dropped:95 overruns:0 frame:0
TX packets:2246 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:489904 (478.4 KiB) TX bytes:278342 (271.8 KiB)

Return to “Networking and servers”