2 Apr 2008 15:23
Question about pf, NAT and routing. (attempt #2)
For some reason my other message never made it through, so here we are
again!
A while ago I needed to give a jail access to two networks/IPs (one
external for a web site and one internal for a DB connection). I ended
up using a localhost IP (127.0.0.2) for the jail and nat/binat in pf to
control where the traffic went, depending on destination. I'm trying to
set up a jail now that's similar. My host has multiple interfaces on
multiple networks, and the jail is on lo0, and I would like to NAT
traffic to internal networks from one IP out one interface, and
everything else out another IP through the external interface.
I found an email on here from jpaetzel (o/) explaining how to use
route-to, and that works; it fixed default route problem (thanks!).
Unfortunately that only seems to work if the jail is using an IP on one
of the interfaces in question. I suppose there is some sort of problem
between the NATing and routing.
Here is my crazy config:
ra# ifconfig
bce0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
1500
options=1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4>
ether 00:1e:0b:ed:f9:ec
media: Ethernet autoselect (1000baseTX <full-duplex>)
status: active
lagg: laggdev lagg0
bce1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
(Continue reading)
RSS Feed