• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Dreamplug How to Connec to WAN via WAP  (Read 2960 times)
bazza14
Newbie
*

Karma: 0
Posts: 16


View Profile
« on: January 06, 2012, 03:54:44 AM »

I've got me new Dreamplug and having a a lot of fun with it but one thing is defeating me, connecting to the internet through the WAP. Here's the story briefly, bricked it on day one. Got a Debian Squeeze img from NewIt. My network is 192.168.1.0 so I changed all references to 192.168.1.* in init_setup.sh, dnsmasq.conf and udhcpd to 192.168.2.* . Great, can access the device wirelessly. I can access servers on my network, ftp and www but I can't access the WAN.
Monitoring with wireshark and me routers logging tool I can see that requests to servers on my LAN are correctly originating from 192.168.1.92 (eth0 on the plug) but requests to the WAN are coming from 192.168.2.104 (the ip of the device from uap0) which is why I can't get out or more correctly don't receive a reply.
So it seems when it needs to use DNS to get an IP it somehow does not NAT the request to the IP !!!? Help, I've been beating me head against this for days, everything I've read suggests this should be working.
Logged

Hell-G
Newbie
*

Karma: 2
Posts: 13


View Profile
« Reply #1 on: January 07, 2012, 07:41:56 AM »

Hi bazza14

I guess I cannot help you, but as I want to use my D2plug as an access point, I want to understand better.
I understand that your situation is 192.168.1.0 is the wired network and 192.168.2.0 is the wireless network. You want to use the plug on 192.168.2.104 as your access point and route the traffic over 192.168.1.92 to the router over cable and from there to the WAN.

Quote
Great, can access the device wirelessly. I can access servers on my network, ftp and www but I can't access the WAN.

Does that mean, that you can access your plug over wireless from another computer and also over wireless to other computers inside your LAN which have only wired connection?

Could you try to reach an external address by IP? For instance google on 173.194.35.51?
Logged

bazza14
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #2 on: January 07, 2012, 03:39:11 PM »

192.168.1.0 is my LAN
192.168.2.0 is the network assigned to uap0 the wireless interface on the plug which has the address 192.168.2.1
192.168.1.92 is the address statically assigned to eth0 on the plug
192.168.2.104 is the address that is dynamically assigned to the device that is connecting to uap0.
The address is assigned by dnsmasq running on the plug. Dnsmasq also supplies dns services.
NAT is enabled by iptables on the plug so all traffic leaving the plug on eth0 will appear to originate from ip address 192.168.1.92.
This works for traffic from 192.168.2.104 destined for the LAN but anything destined for the internet arrives at the router with an originating ip of 192.168.2.104  Shocked
So anything that requires a DNS lookup somehow bypasses iptables  Shocked
Typing an ip address into a browser will still result in a dns lookup.
Logged

spinifex
Full Member
***

Karma: 8
Posts: 167



View Profile WWW
« Reply #3 on: January 07, 2012, 05:11:03 PM »

In the original init_setup.sh there is something like:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward


Make sure you still have this
Logged

bazza14
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #4 on: January 07, 2012, 07:07:37 PM »

Yes that is still there and working, as I stated above traffic sent to the LAN gets NAT'd but I am now one step closer to a solution.
The traffic arriving at the router that originates from 192.1.168.2.104 is getting there via eth1 on the plug so that explains why it's not NAT'd  Smiley That gets rid of one red herring.
Logged

Hell-G
Newbie
*

Karma: 2
Posts: 13


View Profile
« Reply #5 on: January 08, 2012, 05:45:03 AM »

That would explain it.
Can you just remove the cable on eth1?
Where would you set to route the traffic from 192.168.2.0 to eth0 and not eth1?
Logged

bazza14
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #6 on: January 08, 2012, 01:05:57 PM »

The routes get set up automatically from the info supplied in /etc/network/interfaces although you can edit them with 'route'.
For now I've unplugged eth1.
Logged

bazza14
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #7 on: January 09, 2012, 02:06:50 AM »

I do not believe it. I knew it would be a simple fix once the problem was identified, 'masquerade' is to be used when the gateway (in this case eth0) gets it's address via dhcp, if it has a static ip you should use 'snat'. I changed /etc/network/interfaces to 
Code:
iface eth0 inet dhcp
and away we go.
Now to get this thing configured to serve me website.
Logged

Hell-G
Newbie
*

Karma: 2
Posts: 13


View Profile
« Reply #8 on: January 09, 2012, 03:15:15 PM »

Great!

You can get your router to give a "fixed" IP also on dhcp. So I guess a practical solution for you. Nice!
Logged

Pages: [1]
Print
Jump to: