OpenVZ Forum


Home » General » Support » port forwarding if using bridge
port forwarding if using bridge [message #51564] Mon, 28 July 2014 12:01 Go to next message
hkendusers is currently offline  hkendusers
Messages: 12
Registered: June 2010
Junior Member
Hi all,

I have googled and search in forum, but seems no solution.

Currently I am using port forwarding on OpenVZ according to openvz.org/Using_NAT_for_container_with_private_IPs and it is working fine.

e.g.:
iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT --to IP_ADDRESS:2345


And now I am testing to use bridge network according to openvz.org/Virtual_Ethernet_device

It is working fine too. However I would like to know how I could also use port forwarding for this container with bridged network?


For details network:
Hardware node IP: 12.34.56.78 (eth0), 78.90.12.34(vzbr0)


Container 101 IP: 12.34.56.100 (non bridged network)
Container 102 IP: 78.90.12.100 (bridged network)


Re: port forwarding if using bridge [message #51574 is a reply to message #51564] Mon, 04 August 2014 02:38 Go to previous messageGo to next message
hkendusers is currently offline  hkendusers
Messages: 12
Registered: June 2010
Junior Member
Hello, could anyone help? Smile
Re: port forwarding if using bridge [message #51582 is a reply to message #51574] Wed, 06 August 2014 00:14 Go to previous messageGo to next message
devonblzx is currently offline  devonblzx
Messages: 127
Registered: December 2006
Senior Member
I haven't yet tried with the veth devices but have you tried a solution using ebtables?

http://static.openvz.org/userbars/openvz-user-2.png
ByteOnSite President
Re: port forwarding if using bridge [message #51584 is a reply to message #51582] Wed, 06 August 2014 07:01 Go to previous messageGo to next message
hkendusers is currently offline  hkendusers
Messages: 12
Registered: June 2010
Junior Member
Thanks Devonblzx,

Sorry that I never use ebtables and I am not familiar with it Sad

Can it be used together with iptables? Or I need to change all my iptables ruleset to ebtables?

Would you give me some hints for it?
Re: port forwarding if using bridge [message #51587 is a reply to message #51564] Wed, 06 August 2014 17:03 Go to previous message
devonblzx is currently offline  devonblzx
Messages: 127
Registered: December 2006
Senior Member
ebtables runs alongside iptables and is for bridges. I'd suspect that the syntax is very similar but you may need to use the MAC address of the veth device instead of the IP address like you would with venet/iptables.

There are examples on their site you can review: http://ebtables.sourceforge.net/examples/basic.html

You're going to have to do some fooling around with it if noone else here can help but be sure to share your input here or consider writing a page on the wiki if you find some things out.


http://static.openvz.org/userbars/openvz-user-2.png
ByteOnSite President

[Updated on: Wed, 06 August 2014 17:04]

Report message to a moderator

Previous Topic: Ploop Error
Next Topic: Mount a XFS partition inside VE with raw io ?
Goto Forum:
  


Current Time: Thu Mar 28 17:26:19 GMT 2024

Total time taken to generate the page: 0.01734 seconds