* NAT only selected bridges
@ 2008-07-06 22:49 Pekka Järvinen
0 siblings, 0 replies; only message in thread
From: Pekka Järvinen @ 2008-07-06 22:49 UTC (permalink / raw)
To: netfilter
Hello,
I have
VLAN 111 - LAN
VLAN 222 - WLAN
VLAN 333 - ADSL Modem
VLAN 444 - Internet (connecting through VLAN 333)
br0 - Internet
br1 - LAN 192.168.0.0/24
br2 - WLAN 192.168.1.0/24
With current setup br1 and br2 are NAT'ed correctly but connections
coming straight from br0 are NAT'ed too for some reason.
So I'm trying to set up rules for something like:
NAT br1 and br2 and don't change IP addresses coming directly from br0
(or VLAN 444).
Here's /etc/network/interfaces:
auto lo
iface lo inet loopback
allow-hotplug eth0
allow-hotplug eth1
iface eth0 inet static
iface eth1 inet static
auto br0
auto br1
auto br2
# Internet bridge
iface br0 inet static
address 62.204.1.12
netmask 255.255.255.128
gateway 62.204.1.1
bridge_ports eth1.333 eth0.444
bridge_stp on
post-up iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
pre-down iptables -t nat -D POSTROUTING -o br0 -j MASQUERADE
# LAN bridge
iface br1 inet static
address 192.168.0.1
netmask 255.255.255.0
bridge_ports eth0.111
bridge_stp on
# WLAN bridge
iface br2 inet static
address 192.168.1.1
netmask 255.255.255.0
bridge_ports eth0.222
bridge_stp on
# -----
ipv4 forward is enabled.
--
Pekka Järvinen
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-06 22:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-06 22:49 NAT only selected bridges Pekka Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox