routing IP packets from internal network through cable modem

zero_pee

Registered
Hi! I am running a cable modem in my home, but I don't want to purchase the software required to share this connection through a hub.

I know there a re a few shareware products out there that do this, but Unix is capable of doing this through some none-so-fancy modifications through the command line, or so I have read. I have not, however, found any really good guide to doing this.

I'm wondering if anybody out there has gone the high road with this situation and is willing to share their adventure with me?

Thanks
Zero_pee
 
Thanks for the information! I wanted to set it up with two NICs, but I only have one for each of the six computers we're networking. I actually ended up using geeRoute, and it works pretty well, I have to restart it every 36 hours, but that's a small price to pay to have it actually work.

Does your double NIC solution stay pretty stable?

thanks again...

zero_pee
 
I never really HAVE to reboot regarding nat. It has run for over a month with out ever having to be restarted. 10.1 did give me some problems with the system going to sleep tho. Everytime the hard drive would go to sleep nat would stop working. The workaround is easy, just set the hard drive to never sleep.

I haven't really even noticed a hit on performance either. but im only sharing a connection with one other computer. Six might be a different story, but i would be interested to hear if there was any noticeable performance loss.

By the way, if you read the entire thread, I think someone explains how to make natd work with only one ethernet card. Maybe it was a different thread, but I know it can be done without too much hassle.

Hope this helps.
 
I was bored, so i looked it up. I haven't tried the single card method, but it should work.

This is a part of the post originally written by whirk,

<snip>
Here's what my single ethernet interface script looks like now (and has been working great for the past month - uptimes of 12 days straight with natd working fine the whole time (too bad I had to restart to install other software)). Anyways, here it is:

UW PICO(tm) 2.3 File: rc.natd

#!/bin/sh

ifconfig en0 alias 192.168.0.1 netmask 255.255.255.0

natd -interface en0

/sbin/ipfw -f flush
/sbin/ipfw add divert natd all from any to any via en0
/sbin/ipfw add allow ip from any to any

----------
NOTE: en0 is configured as it would normally in the network control panel with my real IP and netmask supplied by my cable provider. The Alias address in the script is the internal ip that clients on my network put in as the router address.

</snip>

Give it a shot, maybe it will end the need to restart every 36 hours.
Let me know how it works out.
 
So, I have been checking in with top every so often when I am downloading, or when someone else in the network is (or playing Return to Castle Wolfenstein, or both) and I have seen no appreciable hit in performance. At the most, I have seen natd take 0.03% of my CPU time, and that's just plain acceptable to me.

Everyone else in this network uses windows, we tried to set this up on all of their computers too to no avail. They are a little surprised (and one even a bit bitter) that it works on OSx so well...tee hee.

I'm going to try that script later this afternoon.

thanks again!
 
Back
Top