[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to do nat when external interface uses dhcp ?



following is my simple pf.conf;
------pf.conf begins--------------------------
# config file for packet filter mc 021102
EXTIF="ep1"              # External Interface
EXTIP="212.90.72.110"	 # External IP
INTIF="ep0"              # Internal Interface
INTNET="192.168.0.0/24"  # Internal Network
PRIVATEIPS="{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"

scrub in all

nat on $EXTIF from $INTNET to any -> $EXTIP

block in  quick on $EXTIF from $PRIVATEIPS to any
block out quick on $EXTIF from any to $PRIVATEIPS

block in on $EXTIF all

pass in on $EXTIF proto tcp from any to $EXTIF port 22 flags S/SA keep state
pass in on $EXTIF proto udp from any to $EXTIF port 22            keep state

block out on $EXTIF            all

pass  out on $EXTIF proto tcp from any to any port 137<>139 flags S/SA keep state
pass  out on $EXTIF proto udp from any to any port 137<>139            keep state
pass  out on $EXTIF proto icmp all                                     keep state
--------pf.conf ends------------------------------

...but how to write the NAT clause if my external inface used
dhcpclient ??!

/mc

Use the Source !  <Yoda>



Visit your host, monkey.org