Note: This document has been updated to include steps to configuring a linux ip masquerade (NAT) LAN router for a cable modem. See 'How do I get my LAN to see the internet..' below. |
Not only can crackers and spammers harm you and your data, but they
can also harm others, using your machine in such a way that it looks
like you're the culprit.
When asked if they support Unix:
This last statement about hubs and routers is of special consideration.
You cannot just plug the cable modem into your LAN's hub when the installers leave,
and expect all the machines on your LAN to see the cable modem.
The cable modem will only want to talk to ONE ethernet card; the one they
configured it to talk to. Your cable modem will be intimately associated
with your network card's MAC address (aka. ethernet address) when MediaOne
configured the modem.
However, you can configure a linux machine to be an IP MASQUERADE
router. This means two network cards in the linux machine; one
connects to the cable modem, the other to your hub. This is descibed
in the section below,
'How do I get my LAN to see the internet..'.
Why cable modems kick ass
They're fast (800kbs down, 100kbs up).
They're cheap ($40/mo).
They're online 24 hours a day.
They're simple (a box with a 10Base-T Ethernet connection).
Considerations regarding Unix on cable modems
If you hang a unix machine off the internet, you better read up
on firewalling.
A description of MediaOne's service
The following is an excerpt from MediaOne, when asked 'Can one
hook up a unix machine to the MediaOne cable modem?':
We use TCP/IP protocol that runs over a 10BaseT network connection. If
after our field technician leaves your house from installing to a
supported OS, you then change your platform to one which we do not
support, we probably will not know unless you do something which causes
problems on our network. A perfect example of this: you install Linux
and by default it leaves ports open on your machine. An enterprising
'outsider' runs a script to find open ports on the network and finds
your machine. That person then uses your machine as a gateway to 'spam'
the mail server. The effect of this is that other customers of ours
have less-than-adequate mail service. Our only solution is to
deprovision your service because you are running an unsupported
configuration that has caused a problem on our network.
When we arrive at your house to install the service, we will only
install to operating systems which we will support. These systems
include Windows 95, Windows NT Workstation, and MacOS 7.5.3 or higher
which run Open Transport. Unfortunately, it is not possible to support
all OS environments given the training and support necessary to complete
installations, technical support and troubleshooting. The same can be
said of LAN's from the point of view of training and support, but in
addition to that there are other issues like security to be concerned
with. Also, a hub or router will not work with a cable modem.
Linux specific info
These are some linux to linux specific info with regards to cable
modems:
MediaOne, as Jennine has probably told you already, wants only a Mac or a PC. Period. You can call their tech support number and have them login into the cable modem and change the MAC address. (Yes they lock you to one MAC address)
I don't know if proclaim works around /etc/resolv.conf. I hardcode the /etc/resolv.conf. I have an O2 at home that is on MediaOne's cable modem. Once I chkconfig autoconfig_ipaddress on and proclaim_client (I think) on, things went automatic.
I edited /etc/config/static_route.options (I think that's the filename) and add the default router. [I think] netmask is default.
This is something I want to do, but haven't done. Yes, I think that can be done. I think Jennine has managed to do something like that with the TIS firewall kit.
You're right. Using socks, the applications on the PC/Mac can have the internet services, but to the outside systems, all the packets are coming from one IP address. |
..pretty typical; 3 machines on a hub, one of them a linux machine
acting as a PPP router to the internet over a telco modem on a POTS line.
For information about why I'm using 192.168.*.* on my private LAN, see
RFC 1918
for info on reserved IP numbers for private networks.
Ok, now we get the cable modem. I put WinNT on 'firewall' so that MediaOne
has something to test the cable modem. I knew that when they left, the
cable modem would be configured to ONLY communicate with that machine's
network card. So this is now the 'golden' network card.
When they leave, I blow away WinNT, and install RedHat Linux 5.2.
During network configuration stage of RedHat installation, I tell it
'use DHCP'. I also make sure to configure
all network daemons OFF, eg. NFS, FTP, sendmail, etc. (I can do this
later, too, with chkconfig(1))
After the machine boots, I comment out just about everything in
/etc/inetd.conf, and 'killall -HUP inetd' to hash in
the changes. I can now talk to the internet with this machine. That's nice.
Do a little surfing, and make note of the speed ;)
Now I shutdown, install a SECOND network card, connect it to my hub.
Then I reboot, and configure the new card eth1 to be the old
IP address of "firewall":
The new card is shown as 'eth1', and the original card is 'eth0'.
The eth0 address is xxx'ed out, because MediaOne changes it regularly
via DHCP.
Here are the steps I used to bring up the second ethernet card, and enable
routing for my 192.168.10.* network on eth1:
The trick now, is to hide our unassigned network addresses from the
internet, by configuring the firewall to do
ip masquerade (ie. NAT, Network Address Translation) packet forwarding.
The commands I used:
Now it's just a matter of configuring the other workstations to use
"firewall" as their gateway to the internet. For instance, on Linux machine
'rotwang', I configure the /etc/resolv.conf to use MediaOne's
nameservers:
On an SGI, you could use:
If you have a windows machine, it's pretty trivial; just add "firewall"
as a gateway (Control Panel -> Network -> Tcp -> Gateway=192.168.10.1,
DNS=mediaone nameservers)
The finishing touches:
To get FTP to work properly through an ip masqueraded firewall on your
clients, you will want to install the ip_masq_ftp.o module as the last
command after all your ipfwadm(1) commands in your boot script, eg:
If you have trouble, RTFM. There's much good documentation on your own
machine for routing, ip masquerade (NAT),
and DNS configuration. With RedHat 5.2, there's:
How do I get my LAN to see the internet thru my Linux gateway?
Given a small network, here was what I started with before the
cable modem:
"firewall" "howland" "rotwang"
Telco ___________ ppp _____________ _____________ _____________
_____| 28K modem |_____| | | | | |
|___________| | 192.168.10.1| | 192.168.10.2| | 192.168.10.3|
|_____________| |_____________| |_____________|
|eth0 | |
| | |
`--------------. | .--------------`
___|__|__|____
| |
| enet hub |
|______________|
"firewall"
_______ _____________
| | | | "howland" "rotwang"
| Cable |------eth0| xx.xxx.xx.xx| _____________ _____________
| Modem | | | | | | |
|_______| .---eth1| 192.168.10.1| | 192.168.10.2| | 192.168.10.3|
| |_____________| |_____________| |_____________|
| | |
| | |
`-----------------------------. | .--------------`
___|__|__|____
| |
| enet hub |
|______________|
ifconfig eth1 192.168.10.1 up
route add -net 192.168.10.0 netmask 255.255.255.0 dev eth1
So now the firewall should be able to ping addresses on the internet
(via eth0) and ping addresses on my lan (via eth1). Cool, but since
the machine was configured to be a firewall, packets from the other
machines on my network will not (and SHOULD NOT!) reach the internet.
ipfwadm -F -p deny
ipfwadm -F -a m -S 192.168.10.0/255.255.255.0 -D 0.0.0.0/0
echo 1 > /proc/sys/net/ipv4/ip_forward
That's it. All these commands, once tested, would be configured into
the boot scripts, ie. /etc/rc.d./rc.local.
(update 07/29/00: I upgraded to RedHat 6.1, and now use
an ipchains oriented script
to configure my firewall, as well as these
tweaks to prevent internet based
abuse of my various unix services.)
domain mydomain.com
nameserver 24.xxx.xxx.xxx
nameserver 24.xxx.xxx.xxx
nameserver 24.xxx.xxx.xxx
..and make sure there is a default route to "firewall", so all internet
bound traffic is forwarded to it:
route add default gw 192.168.10.1
At this point, "rotwang" should be able to ping addresses on my lan,
and addresses on the internet.
/etc/resolv.conf:
# MEDIAONE NAMESERVER
hostresorder local bind
domain erco.com
nameserver 24.xxx.xxx.xxx
nameserver 24.xxx.xxx.xxx
nameserver 24.xxx.xxx.xxx
Routing:
route add default 192.1.2.3 1
RJ45 Switch
An RJ45 data switch lets me easily disable the internet connection.
(I leave it off as an ultimate means of security ;) Basically, just an
A/B switch that has RJ45 connectors on the back, instead of DB-25s, etc.
DNS Caching Nameserver
Configuring a DNS caching nameserver on your firewall will allow you
speedier name lookups, and can help simplify handling name server lookups
should the provider decide to switch DNS servers on you.
Getting FTP to work
FTP is weird in that, when you start a download, the remote host opens
A SECOND connection back to your machine to do the download, which your
firewall will of course reject. The result is your PUT/GET commands will
hang.
# (ipfwadm commands go here)
# INSTALL FTP MODULE
/sbin/insmod /lib/modules/2.0.37/ipv4/ip_masq_ftp.o
^^^^^^
(your OS version number)
/usr/doc/HOWTO/NET-3-HOWTO
/usr/doc/HOWTO/mini/IP-Masquerade
/usr/doc/HOWTO/DNS-HOWTO
Good luck!
Reference
Golden Network Card
Actually, if you need to use a different network card, you can call
MediaOne and have them reconfig the cable modem remotely to use your
different card. You will need to give them the Ethernet Address
of the new card (6 two digit hex values, eg. xx.xx.xx.xx.xx.xx).
You can get this number from 'ifconfig eth0'.
Use DHCP
MediaOne uses DHCP to configure the machine's IP address and DNS info
automatically. This is good, because then we don't even have to configure
IP addresses, DNS info, etc. DHCP takes control of all that! Fine.
Back to my home page.
© Copyright 1997, Greg Ercolano. All rights reserved.