Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-29-2007, 03:22 PM   #1
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian 6-7, WIN 7-10, WIN SRV 03-12r2
Posts: 1,312

Rep: Reputation: 98
iptables rules to bridge traffic

Hey all some of you might be getting tired of my posts, about xen networking, sorry if that's the case but here is where I am with everything.

I have a dummy interface setup dummy0
I have actual interface wlan0

dummy0 is used to setup the bridged network with xen default network scripts. This works all right provided I set the IP settings manually in the windows VM. I can then ping the dummy0 interface, and ping the wlan0 interface (the assigned ip address -- but I cannot ping the router for the wlan0 connection ( or get out to the internet. I can only guess this has to do with forwarding packets from the dummy interface through the wlan0 connection.

Can anyone tell me the appropriate iptables rules to apply to make this work?
Old 08-31-2007, 07:20 AM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You will want to put something like this into a script:

iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface dummy0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
The last line is important, since you need to tell the kernel to enable IP forwarding in addition to the iptables rules.
Old 08-31-2007, 12:05 PM   #3
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian 6-7, WIN 7-10, WIN SRV 03-12r2
Posts: 1,312

Original Poster
Rep: Reputation: 98
Thank you for your reply, I had actually all ready tried that and it didn't work, what I ended up doing was setting up a squid proxy and setting the vm to use the proxy server and now all works well. It seems that the wlan0 interface didn't want to send anything not from the dom0 so it discarded everything from domU(vm).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM
Fedora Core 5: Bridge, only allows pings to specific IP address. No other traffic big_ginge21 Linux - Networking 7 01-04-2007 07:49 PM
IPTABLES - rules in /etc/sysconfig/iptables The_JinJ Linux - Newbie 6 11-20-2004 01:40 AM
Remove traffic shaping rules gazzer82 Linux - Networking 5 10-21-2003 09:43 AM
iptables bridge firweall revres xunil Linux - Networking 5 08-25-2003 12:24 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:08 AM.

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