networking 101 and then some...
Ben Pfaff
pfaffben@msu.edu
23 Dec 2000 10:22:19 -0500
"Don Chorman" <damedged@home.com> writes:
> Here is my setup (again..I know sorry):
>
> Linux machine: 2 ethernet cards: 1 connected to modem
> 1 connected to win98box
> winbox: 1 ethernet card: still configured for modem.
>
> I wrote down the tcp/ip settings for the win98box, so I can
> revert back, just in case. Last night, I ran some rj45 from
> eth0 (linux machine) to my cable modem. I played with some
> settings (host/domain, IP, gateway, DNS)and I can access the
> internet. I have not been able to send email since the
> re-install. I think I have to set some rules or something,
> because I could send email before the re-install. I checked the
> mail sever name, and it appears ok.
>
> Can I leave eth0 alone, since it connects to the modem ok?
> How should I set up eth1, and my win98 eth?
First of all, could you please watch your line lengths? I run in
a 132-column mode but I'm sure that most people don't. I've
refilled your paragraphs above to 65 characters in length.
Okay, what you need to do is design an internal network. You can
use the 192.168.x.y netblock to do this. For instance, if you
wanted to use 192.168.86.1 for the linux box and 192.168.86.2 for
win98box, you could set up the linux box on eth1 as follows:
ifconfig eth1 192.168.86.2 netmask 255.255.255.0
route add -net 192.168.86.0
and then turn on IP masquerading with
echo 1 > /proc/sys/net/ipv4/ip_forward
ipfwadm -F -p deny
ipfwadm -F -a m -S 192.168.86.0/24 -D 0.0.0.0/0
You'll also want to add the machines to /etc/hosts:
192.168.86.1 linux
192.168.86.2 win98box
The setup on win98box is simple. Just set the IP address and
netmask as they logically should be, and set the gateway address
to 192.168.86.1.
That should about take care of basic setup. Have you looked at
my guide to this? It's on my webpage at
http://www.msu.edu/~pfaffben/writings/index.html
You want the one titled "IPv4 Masquerading for the Hypothetical
Geek".