Inside/Outside Upstairs/Downstairs, or
How to set up your home network and connect it to the world
Manitoba UNIX User Group
June 8, 1999
Michael Doob
Why set up a home net
-
Shared facilities: hard disk, printer
-
Shared access to the internet
-
It's the best way to learn what's going on
Ethernet cards
-
Card settings (either autosensed or with diskette software):
-
Base address (typically 0x300 or 0x320)
-
Int number (typically 10 or 11)
-
Checking settings on a working system (with ifconfig)
down [11]% /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:00:B4:39:DB:18
inet addr:207.161.150.xxx Bcast:207.161.150.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25612670 errors:0 dropped:3 overruns:0 frame:2627
TX packets:3547293 errors:0 dropped:0 overruns:0 carrier:0
collisions:7394
Interrupt:11 Base address:0x320
Wiring types
-
Coax (or 10Base2) looks like cable video line
-
coaxial wire
-
uses linear topology
-
advantages: simpler linear topology, easier to expand, no hub
-
disadvantages: wiring a bit harder to pull, harder to add BNC
connectors, trailing edge technology
-
10BaseT or 100BaseT
-
twisted pairs of wires looks like telephone line
-
star topology
-
advantages: easy to get fixed lengths, easy to upgrade to 100BaseT,
easier to pull
-
disadvantages: hubs need power, more complicated to expand
Setting up a home network
-
special addresses
-
10.xxx.xxx.xxx (netmask: 255.0.0.0)
-
172.16.xxx.xxx (netmask: 255.255.0.0)
-
192.168.xxx.xxx (netmask: 255.255.255.0)
-
assigning addresses to machines
-
control-panel or
-
mdoob@up ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain
10.0.0.3 down
10.0.0.6 charm
10.0.0.1 up
-
Setting the netmask
-
control-panel or
-
[mdoob@up network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
BOOTPROTO=
BROADCAST=10.255.255.255
NETWORK=10.0.0.0
NETMASK=255.0.0.0
IPADDR=10.0.0.1
-
getting Linux to recognize your ethernet card
-
control-panel or
-
[mdoob@up ~]$ cat /etc/conf.modules
alias eth0 ne
options ne io=0x300 irq=10
-
checking things out with ifconfig
(same as in the section on Ethernet cards)
An example: the Quark home LAN
The quark network using coax cables (linear topology)
The quark network using 10BaseT cables (star topology)
Connecting to the outside world using IP masquerading
-
Getting the software from: X/OS
-
The machine that acts as a router (the masquerading machine,
down=10.0.0.3 in the example above)
-
setting up two ethernet cards, or
-
setting up one card and one modem
-
control-panel
-
down [6]% cat /etc/conf.modules
alias eth0 ne
alias eth1 ne
options ne io=0x320,0x300 irq=11,10
-
gateway setting and IP forwarding
down [11]% cat /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4=yes
HOSTNAME=down
GATEWAYDEV=eth0
GATEWAY=207.161.150.1
-
Commands for IP masquerading:
-
RedHat 5.2 ipfwadm
/sbin/depmod -a
/sbin/modprobe ip_masq_ftp.o
/sbin/modprobe ip_masq_raudio.o
/sbin/modprobe ip_masq_irc.o
/sbin/ipfwadm -F -p deny
/sbin/ipfwadm -F -a accept -m -S 10.0.0.0/24 -D 0.0.0/0
-
RedHat 6.0 ipfwadm-wrapper replaces ipfwadm
-
Checking settings (with ifconfig)
down [12]% /sbin/ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
RX packets:24544 errors:0 dropped:0 overruns:0 frame:0
TX packets:24544 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
eth0 Link encap:Ethernet HWaddr 00:00:B4:39:DB:18
inet addr:207.161.150.xxx Bcast:207.161.150.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25615830 errors:0 dropped:3 overruns:0 frame:2627
TX packets:3549328 errors:0 dropped:0 overruns:0 carrier:0
collisions:7395
Interrupt:11 Base address:0x320
eth1 Link encap:Ethernet HWaddr 00:00:B4:39:DC:89
inet addr:10.0.0.3 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:161938 errors:0 dropped:0 overruns:0 frame:0
TX packets:195339 errors:0 dropped:0 overruns:0 carrier:0
collisions:57
Interrupt:10 Base address:0x300
-
Other machines on the home network (the masqueraded machines)
-
gateway settings
[mdoob@up sysconfig]$ cat /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4=no
HOSTNAME=up
GATEWAYDEV=eth0
GATEWAY=10.0.0.3
-
Checking things out with
netstat -M
Using X Window applications with IP masquerading