Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2007 11:31:53 +0300
From:      Igor Popov <>
Subject:   nat on bridge
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
I have a question about NAT (pf) on bridge.

Network diagram: 
[PPPoE clients and real ip] <-->[PPPoE concetrator]<---->[em0 FreeBSD bridge and NAT 
em1]<----->[BGP Router]

Why bridge? Both PPPoE concentrator and BGP router are Cisco routers, there is 
dynamic routing (EIGRP) between them, so it must be directly connected.
FreeBSD should NAT internal ip network and switch on bridge all another 
packets, is it possible?

ifconfig em0 up
ifconfig em1 up
ifconfig bridge0 addm em0 addm em1 up
ifconfig bridge0 inet
route add default

pf rules:
table const <pppoe>  {}

nat on bridge0 tagged TO_NAT tag NATED  -> (bridge0)

pass in on em1 all keep state

pass in on em0 inet tag TO_INET keep state
pass in on em0 inet from <pppoe> to any tag TO_NAT keep state

pass out on em1 tagged NATED
pass out on em1 tagged TO_INET

You climb to reach the summit, but once
there, discover that all roads lead down.
		-- Stanislaw Lem, "The Cyberiad"

Want to link to this message? Use this URL: <>