In article , (jjr) wrote:
>
> You can setup routing without any additional software as it is built in
> but, I don't believe that you want to use sharing unless you do want
> to use NAT. To setup a straight forward router without NAT do this:
....
> Now the system will be able to route between network interfaces and
> there will be no natd daemon running. The machine should be a
> straightforward router. You may wish to run /sbin/routed on the
> machine so that it may advertise its routing table on the network
> interfaces using the RIP protocol.
>
I've scoured the BSD sites, MacOS-Server archives, Googled all-over.
The answers seem to fall into three groups:
1. It just works (with little or no explanation :-(
2. Use NAT
3. (& this one's a little scary) It works if the "sub"net is 198.162.x.y
The Server OS does some checks at boot time to make sure the IP nrs and
hostnames for all its inet ports are registered with upstream DNS. If
not it won't serve, so that must all be 100%, and mine is (AFAICT).
The Server OS has a few other little hidey places for config details,
<a rel="nofollow" style='text-decoration: none;' href="http://docs.info.apple.com/article.html?artnum=107637" target="_blank">http://docs.info.apple.com/article.html?artnum=107637</a>
has a script with all the details.
I have
[qtss:~] peterk% sysctl -a | grep -i forward
net.inet.ip.forwarding: 1
net.inet.ip.fastforwarding: 0
net.inet6.ip6.forwarding: 0
[qtss:~] peterk% sudo ipfw list
Password:
65535 allow ip from any to any
[qtss:~] peterk% netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif
Expire
default 130.216.239.254 UGSc 4 6 en0
127.0.0.1 127.0.0.1 UH 16 3606 lo0
130.216.1.1 130.216.239.254 UGHW 3 13 en0
130.216.224/20 link#5 UCS 4 0 en0
130.216.231.1 127.0.0.1 UHS 0 0 lo0
130.216.231.2 127.0.0.1 UHS 0 0 lo0
130.216.231.80/28 link#4 UCS 0 0 en1
130.216.231.94 127.0.0.1 UHS 0 0 lo0
130.216.239.254 0:a:42:41:2f:fc UHLW 4 0 en0
1198
169.254 link#5 UCS 0 0 en0
224.0.0.251 130.216.239.254 UGHW 3 89 en0
239.255.255.253 130.216.239.254 UGHW3 0 13 en0
3587
3rd line 130.216.1.1 is main site DNS
4th line 130.216.224/20 is faculty vlan, or "world" for my router
line 5 is the IP nr of my server/router
line 6 is an alias for a web server hosted on the same box
line 7 is the subnet I wish to firewall and route
line 8 is the registered IP for the 2nd NIC, router for the subnet
Some solutions say I must add a route from my subnet to the port
facing the world. If I
[qtss:~] peterk% sudo route delete -net 130.216.231.80/28
[qtss:~] peterk% sudo route add -net 130.216.231.80/28 gateway \
130.216.231.1
add net 130.216.231.80: gateway gateway
[qtss:~] peterk% netstat -nr
......
130.216.231&0x82d8e701 130.216.191.83 UGSc 0 0 en0
??!!
I also observe a wide disparity in recommendations of what value should
be entered for the gateway for the 2nd NIC:
leave it blank and the system uses the local default;
use 0.0.0.0 (which is s'posed to have the same effect);
use its own IP nr (since it is the router for the subnet);
use the IP nr of the port facing the world;
use the IP of the world gateway;
Since this is Server OS it pays to check and manually correct if needed,
that the numbers are written to:
/var/db/SystemConfiguration/preferences.xml
/System/Library/ServerSetup/Configured/null_POR.plist
/System/Library/ServerSetup/UnConfigured/POA.plist
still no cigar...
Clients on the subnet can access everything on the server,
clients from the world can access everything on the server,
there's no route thru :-(
The fact that routed shuts down the world interface makes me
think I've still got something wrong.
>> Stay informed about: Software Router for OS X ?