LinuxQuestions.org
Review your favorite Linux distribution.
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 12-15-2010, 04:37 PM   #1
brianmcgee
Member
 
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Rep: Reputation: 40
Iptables and network bridge


Hello,

I have the following XEN network setup at hand:
Code:
IPTABLES
br0 - Public IP 123.123.123.123
+---eth0

vbr0 - DMZ IP 192.168.1.1
+---vif Virtual Machine with IP 192.168.1.42
Goals:

Forward requests on tcp port 80 to the virtual machine with the IP 192.168.1.42.
The virtual machine should get updates from the internet
The virtual machine should successfully ping Public IP 123.123.123.123
The virtual machine should successfully ping 192.168.1.1
The virtualization host should successfully ping 192.168.1.42
IPtables has default drop policy.

Some thoughts:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward 2> /dev/null
# Forward port 80 to httpd in virtual machine
iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
iptables -A INPUT -i br0 -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -i br0 -m state --state NEW -p tcp -d 192.168.1.42 --dport 80 -j ACCEPT

# Allow internet access in virtual machine
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.1.42/255.255.255.0 -o br0 -j SNAT --to 123.123.123.123
Currently working/not working:
Internet in the virtual machine is ok: VM can ping google and wget index.html
VM does not get ping reply to ip 192.168.1.42, 192.168.1.1 nor 123.123.123.123

How can I further debug this issue? What did I miss? Thanks!

Last edited by brianmcgee; 12-17-2010 at 02:40 PM. Reason: Solved.
 
Old 12-16-2010, 08:43 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
Maybe this thread will help.
 
Old 12-17-2010, 02:39 PM   #3
brianmcgee
Member
 
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Original Poster
Rep: Reputation: 40
Thanks for the help!

The solution was trivial. All was setup correct. Icmp was ignored by host. The following code solved the issue:

Code:
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
 
  


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
Debian Iptables 3 nic bridge chrysolidocarpu Linux - Networking 1 04-10-2010 04:34 PM
Anyone using a bridge firewall with iptables and ebtables? CoffeeKing!!! Linux - Networking 3 11-02-2009 11:10 AM
iptables rules to bridge traffic scheidel21 Linux - Networking 2 08-31-2007 12:05 PM
Linux bridge with iptables and STP wkm001 Linux - Networking 1 02-04-2004 01:37 PM
iptables bridge firweall revres xunil Linux - Networking 5 08-25-2003 12:24 PM

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

All times are GMT -5. The time now is 07:27 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