Talk 25-01-2000 Home Networking Part I: TCP/IP and Samba
From CLUG Wiki
Contents |
Basic IP Networking
Introduction
Network protocols are usually split into layers. IP networks tend to have the following four layers:
+-------------+-----------+ | telnet, ftp | fsp, talk | +-------------+-----------+------+ | TCP | UDP | ICMP | +-------------+-----------+ + | IP | +--------------------------------+ | host network (with own layers) | +--------------------------------+
Devices
Linux network devices do not have entries in /dev/, and are often only
created on demand.
Typical device names include lo, eth0, ppp0,
sl0 or tr0.
Configuring Network Devices
Some network devices are detected at boot time or when the appropriate module is loaded.
Examples of those are lo or eth0.
Others are created by special system calls.
Often these are layered on top of other character devices, for example, a slip device
(eg sl0 is created on top of a serial line using a command like slattach).
Pointopoint devices (eg ppp0 are set up in a similar way using pppd.)
Brining up the network: IP numbers and routes
Normally IP numbers can only be handed out by designated authorities (to ensure that every host on the Internet has a different IP number). If you are running a network completly detached from the real Internet, you could pick your own IP numbers, but that might cause problems if you ever make a connection to the Internet.
Fortunately a number of IP numbers have been reserved for private networks. These IP numbers are not supposed to be routed outside of a LAN, which means that if you ever connect to the Internet you are unlikely to get into trouble. However, it also means that host using these IP numbers are not directly visible to the outside world.
One of those reserved private address spaces is the range 192.168.0.0 to
192.168.255.255 with a netmask 255.255.255.0.
Private networks of this type allow you to have over 250 host on your
home network.
That should be sufficient.
Names
Remembering IP numbers can be tedious, so most hosts arrange that symbolic names can
be mapped to IP numbers.
On big installations one generally uses a name server for this purpose, but for a home
network one can generally hardwire these in the file /etc/hosts.
Apparenly some windows versions used to allow one to have a HOSTS file
in the windows directory, but apparently that has been removed in favour of Microsoft's
proprietary WINS protocol.
Fortunately samba can act as a WINS server, so you can effectively export the content
of /etc/hosts to your windows machines.
Typical Unix Services
Once you know that the lower layers are set up properly (use ping to
verify the link), you should be able to ftp or telnet into your Linux box.
Many services are managed from inetd, so consult /etc/inetd.conf
to (dis)able your selection of services.
Useful Commands
ifconfig- configure the network device
route- manipulate routing tables (less important for recent kernels)
ping- check the connection to a remote host
netstat- show network connections
Further Reading
For more detail consult the Linux Network Administrator's Guide, the NET-? HOWTO or Ethernet HOWTO. All these are part of the LDP (Linux Documentation Project).
