|
#1
| |||
| |||
| Ok so I'm trying to setup natd and ipfw to share my cable modem connection which is a static ip. A bit of background..i have a b&w g3 running osx with a built in ethernet and a pci ethernet card...the built in ethernet (en0) is connected to my cable modem. The pci card (en1) is connected to hub that the rest of the computers on my home network are connected to that I want to share my cable connection with. I've read the posts on configuring natd and ipfw for a ppp connection and tried tweaking it to work with dual ethernet cards but haven't had luck. I have my two ethernet cards configured correctly: en0 is connected to my cable modem - static ip and netmask are set en1 is my internal network connection and the gateway. Its ip is set to 192.168.0.1 and netmask is 255.255.255.0 IP Forwarding is enabled. Heres the script I'm currently working with but is not working properly: --- #!/bin/sh natd -interface en0 /sbin/ipfw -f flush /sbin/ipfw add divert natd all from any to any via en0 /sbin/ipfw add pass all from any to any --- I can't figure out what else I need to add...I've read the man pages for ipfw and natd in depth and am somewhat lost. I think I just need to add something that will enable my en1 port to pass traffic through to the en1 port...? Do I need to add a route for traffic on en1? I'm clueless as to what to do next but feel i'm really close to getting this working... |
|
#2
| |||
| |||
| I used the exact script you posted above (with a DSL connection), and it worked immediately... I'd make sure your interfaces are all up by pinging them from both machines (in both directions). |
|
#3
| |||
| |||
| Quote:
|
|
#4
| |||
| |||
| >It works perfectly for me, I have two network cards and >a cable modem. You are my hero! Well it was working yesterday, and now I couldn't get it to work again today. Strange. |
|
#5
| |||
| |||
| i just discovered that is classic is running NAT will not work... curious eh? |
|
#6
| |||
| |||
| Re: Was classic running? Quote:
I haven't figured out how to get the shell script to execute as a root if I log on as an administrator that is not root. Any suggestions? thanks in advance, tim |
|
#7
| |||
| |||
| Sart on Boot Here, try this link: <a href="http://wopr.norad.org/articles/firewall/booting.html">Firewall Setup</a> |
|
#8
| |||
| |||
| Re: Start natd on Boot Quote:
While continuing to try to find an easy way, I realized that an earlier attempt had a syntax error. To have the natd script setup at boot: 1) login as root 2) create the previously described script (See whirk's and others post) and save it somewhere (this can be done with BBEdit or TextEdit) such as /System/Library/StartupItems/Network/rc.natd 3) go to the Terminal and navigate to file and type "chmod ugo+rx rc.natd" (I'm looking into seeing if this can be done through the Sharing panel in Inspector, I sure hope this can be done in the UI all the way) 4) in the UI (or Terminal) edit the file /System/Library/StartupItems/Network/Network (TextEdit will handle it) 5) before the last "fi" add the line "/System/Library/StartupItems/Network/rc.natd" (assuming that's where you've put the file and how you named it). Restart the system. If the script worked before it should still work and now be automatically executed when the system boots. And yes, I'm looking into some automatic execution simply by having the file in the StartupItems folder without going through the plist method. |
![]() |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using NATD and IPFW to share a cable connectionw with 2 enet cards | whirk | Apple News, Rumors & Discussion | 0 | October 23rd, 2000 12:00 PM |