So I have a bunch of bridge interfaces bound with my main ethernet device (em1
, blame HP). These serve various LXC containers I have running on my server and easily allows me to access them from other physical devices on the network.
name id STP interfaces IP
br0 8000.989096db8b8a no em1 10.10.0.2
veth236T4V 10.10.0.15
veth269GNR 10.10.0.16
vethBYBC0Y 10.10.0.17
These all get their IPs from the main network DHCP (which assigns static leases).
I want to move a service that has been running on the main host (em1
, 10.10.0.2
, ports 9000, 9001) to the first LXC container. I have done this and can now access things through 10.10.0.15:9000-9001
, but everything else on the network expects to see it on 10.10.0.2:9000-9001
.
Traditional port forwarding through iptables
doesn't seem to work. I've tried:
-A PREROUTING -i em1 -p tcp --dport 9000 -j DNAT --to 10.10.0.15:9000
-A PREROUTING -i em1 -p tcp --dport 9001 -j DNAT --to 10.10.0.15:9001
And I've tried br0
instead of em1
but neither work.
In a hail of 3am research I found a load of stuff suggesting I need ebtables
but I'd never even heard of that before. Half of the problem seems to be that most people use lxcbrN
devices with LXC but I needed the external IP. I'm not sure what I need. This isn't helped by the ebtables
documentation seemingly defining the word "port" as something else.
I'm out of my depth. I can't feel the floor any more and I'm starting to tread water. Can anyone throw me a line and say for certain what I need to redirect a couple of ports between bridged interfaces?