LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2009, 10:35 PM   #1
danielkun
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
NAT not working correctly


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

Last edited by danielkun; 04-26-2009 at 10:37 PM. Reason: typo
 
Old 04-27-2009, 03:23 PM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
You should look at ebtables.

http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GNOME not working correctly salmanucit Linux - Software 10 04-23-2011 07:52 PM
Keyboard not working correctly Zakos Ubuntu 0 06-11-2006 02:24 PM
inittab not working correctly with X qtran2 Red Hat 2 06-13-2005 02:58 AM
Nvidia Working Correctly SML Linux - Newbie 9 03-12-2004 10:47 PM
search not working correctly -- i think mrtwice LQ Suggestions & Feedback 7 06-30-2003 02:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration