image
image

Go Back   macosx.com > Content & Information > Apple News, Rumors & Discussion

Reply
 
Thread Tools
  #1  
Old October 23rd, 2000, 04:24 PM
Registered User
 
Join Date: Oct 2000
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
whirk is on a distinguished road
Question

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...
Reply With Quote
  #2  
Old November 8th, 2000, 03:37 PM
Registered User
 
Join Date: Nov 2000
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ChrisL is on a distinguished road
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).
Reply With Quote
  #3  
Old November 9th, 2000, 09:10 PM
Registered User
 
Join Date: Oct 2000
Location: Baator
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Lord Xoi is on a distinguished road
Thumbs up Yehaw

Quote:
Originally posted by whirk
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...
It works perfectly for me, I have two network cards and a cable modem. You are my hero!
Reply With Quote
  #4  
Old November 10th, 2000, 07:32 PM
Registered User
 
Join Date: Oct 2000
Location: Baator
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Lord Xoi is on a distinguished road
Question Re: Yehaw?



>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.
Reply With Quote
  #5  
Old November 14th, 2000, 01:48 PM
Registered User
 
Join Date: Nov 2000
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
judge is on a distinguished road
Question Was classic running?

i just discovered that is classic is running NAT will not work... curious eh?
Reply With Quote
  #6  
Old November 15th, 2000, 05:33 PM
Registered User
 
Join Date: Nov 2000
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Tim Kelly is on a distinguished road
Re: Was classic running?

Quote:
Originally posted by judge
i just discovered that is classic is running NAT will not work... curious eh?
I can confirm this - I had the setup working fine with the cable modem going to en1 and the hub going to en0, and the I launched Classic and it stopped working.

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
Reply With Quote
  #7  
Old November 15th, 2000, 07:25 PM
Registered User
 
Join Date: Nov 2000
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
judge is on a distinguished road
Sart on Boot

Here, try this link:

<a href="http://wopr.norad.org/articles/firewall/booting.html">Firewall Setup</a>
Reply With Quote
  #8  
Old November 15th, 2000, 11:26 PM
Registered User
 
Join Date: Nov 2000
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Tim Kelly is on a distinguished road
Re: Start natd on Boot

Quote:
Originally posted by judge
Here, try this link:

<a href="http://wopr.norad.org/articles/firewall/booting.html">Firewall Setup</a>
I'm going to look into an easier way to creating a startup item. While by Unix standards the described procedure may be a small thing, the Mac way has to have a simpler way to do these things or OS X will not sell a half million copies in its lifetime, much less in a year.

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.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

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


All times are GMT -5. The time now is 07:41 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.