<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div class="ApplePlainTextBody">Hello!<br>
<br>
I'm trying to test out the ipfw3 nat module and I can't seem to get anything to work! The example on the mailing list seems to be out of date (the nat command takes an ip now, not an interface)<br>
<br>
The setup is this:<br>
External nic: em0. IP: 192.168.0.178/24<br>
Internal nic: igb0. IP: 172.23.0.1/24<br>
Computer attached to internal nic: 172.23.0.2/24<br>
<br>
all IPs are static<br>
<br>
my script is as follows:<br>
---------------------------------------------------------<br>
#!/bin/sh<br>
<br>
<br>
INT="igb0"<br>
EXT="em0"<br>
<br>
<br>
if test -z "$(kldstat | grep ipfw3_nat.ko)"; then<br>
<span class="Apple-tab-span" style="white-space:pre"></span>kldload ipfw3_layer4<br>
fi<br>
<br>
if test -z "$(kldstat | grep ipfw3_layer4.ko)"; then<br>
<span class="Apple-tab-span" style="white-space:pre"></span>kldload ipfw3_layer4<br>
fi<br>
<br>
ipfw3 flush<br>
<br>
ipfw3 add allow all via $INT<br>
<br>
ipfw3 nat 1 config ip 192.168.0.178<br>
ipfw3 add nat 1 all via $EXT<br>
ipfw3 nat 1 show state<br>
<br>
ipfw3 add deny all<br>
---------------------------------------------------------<br>
<br>
my rc.conf contains:<br>
---------------------------------------------------------<br>
ifconfig_em0="inet 192.168.0.178/24"<br>
ifconfig_igb0="inet 172.23.0.1/24"<br>
gateway_enable=“YES"<br>
--------------------------------------------------------<br>
<br>
my sysctl.conf is:<br>
--------------------------------------------------------<br>
net.inet.ip.forwarding=1<br>
net.filters_default_to_accept=1<br>
--------------------------------------------------------<br>
<br>
But I cannot ping 8.8.8.8 from the computer attached to the internal nic!<br>
What am I going wrong?<br>
<br>
James</div>
</body>
</html>