Hello
I'm having some trouble setting up a NAT. I'm guessing there's only one step left to get this all working but I can't figure out what..
My current setup looks like this:
-----------------------------------------------
| Beagle Board running Android @ 192.168.0.x |
-----------------------------------------------
|
| Ethernet over USB connection
|
---------------------------------------------------
| Linux Machine @ 192.168.0.100 and 192.168.1.100 |
---------------------------------------------------
|
| Ethernet connection
|
---------------------
| LAN @ 192.168.1.x |
---------------------
What I'd like to do is create a brdige on the "Linux Machine" so that I can access the LAN from the Beagle Board. This was done using the following:
Code:
ifconfig eth0 0.0.0.0 up
ifconfig usb0 0.0.0.0 up
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 usb0
ifconfig br0 192.168.1.100 netmask 255.255.255.0 up
ifconfig br0:1 192.168.0.100 netmask 255.255.255.0 up
When I ping a Windows computer on the LAN side from the Beagle Board, Wireshark detects the connection although the package source IP is 192.168.0.x. So I decide to create an iptables rule on the linux machine.
Code:
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -j DNAT --to 192.168.1.100
My problem is, when I ping a computer on the LAN side (lets say 192.168.1.1) from the Beagle Board, the NAT won't replace the IP in the package from 192.168.0.x to 192.168.1.100 until I ping the linux machine from the LAN side machine (192.168.1.1) notifying the linux machine of it's existance.
Does that make sense?
In other words, My NAT seems to be working as long as I ping the linux machine from the LAN side machine that I want to connect to FIRST. How do I setup the NAT so that I can ping ANY machine on the LAN side from the Beagle Board??
Of course, I am able to ping any LAN side machine from the linux machine itself..
Thank you in advance!
Daniel