LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables rules to bridge traffic (https://www.linuxquestions.org/questions/linux-networking-3/iptables-rules-to-bridge-traffic-580773/)

scheidel21 08-29-2007 03:22 PM

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 -- 192.168.0.101) but I cannot ping the router for the wlan0 connection (192.168.0.1) 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?

MS3FGX 08-31-2007 07:20 AM

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

Code:

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.

scheidel21 08-31-2007 12:05 PM

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).


All times are GMT -5. The time now is 05:54 PM.