|
#1
| |||
| |||
| Help with natd & ipfw I have two networks in my location. The first is a 100Mbps wired & 802.11g wireless network operating on subnet 192.168.1 with subnet mask 255.255.255.0. The second is a 10Mbps wired & 802.11b wireless network operating on subnet 192.168.2 with subnet mask 255.255.255.0. A MacBook is on the 802.11g network and has address 192.168.1.100. Another machine is on the 10 Mbps wired network and has address 192.168.2.229. A Mac mini is on both networks. Interface en0 has IP address 192.168.1.226. Interface en1 has IP address 192.168.2.200. Here is a picture: http://i159.photobucket.com/albums/t...gy/Network.jpg I am trying to use natd & ipfw on the Mac mini to create a bridge between the two networks. I want to be able to ping from all directions, and for the devices on the 192.168.2 network to be able to reach the internet. So far I have been using $ sysctl -w net.inet.ip.forwarding=1 $ natd -v -interface en0 $ ipfw add divert natd all from any to any via en0 But it doesn't appear to be routing any of the traffic. Any ideas? |
|
#2
| |||
| |||
| Nevermind. Got it working. |
|
#3
| |||
| |||
| Hi, I am wondering how you got it to work. I have been struggling with an similar setup. Thanks! |
|
#4
| |||
| |||
| Quote:
Code: #!/bin/sh
. /etc/rc.common
ConsoleMessage "Configuring Network Bridge"
IPFW=/sbin/ipfw
# Enabling IP Forwarding
sysctl -w net.inet.ip.forwarding=1
# Starting NAT
natd -interface en0
StartService ()
{
if [ "${FIREWALL:=-YES-}" = "-YES-" ]; then
CheckForNetwork
# check for network
if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
# clear all rules
ConsoleMessage "Flushing IPFW Ruleset"
${IPFW} -f flush
ConsoleMessage "Starting IPFW"
# Allow loopback traffic; deny spoofing
ConsoleMessage "Starting NAT"
# Start NAT diverting
${IPFW} add divert natd all from any to any via en0
${IPFW} add divert natd all from any to any via en1
# Allow outgoing traffic
#${IPFW} add 65535 allow all from any to any
fi
}
StopService ()
{
ConsoleMessage "Stopping Bridge"
}
RestartService () { StopService; StartService; }
RunService "$1" |