IPs and Netmasks
somebody asked about this, so i knocked out this quick email:
The netmask tells the tcp stack which range of ip’s are on the local
network, i.e. any packets for ip’s in this range can jut be dumped
onto the local net and the other machine will find them. Conversely
anything outside the netmask should be sent to the default router.
If you had:
box A:
ip: 192.168.1.1
netmask: 255.255.255.0
box B:
ip: 192.168.1.2
netmask: 255.255.255.0
Assuming they were cabled correctly, they would just find each other,
because the netmask of 255.255.255.0 says 192.168.1.1 - 192.168.1.255
is on the local net.
If you changed box B to 192.168.2.2 it wouldn’t know how to
reach box A anymore and would therefore send all packets to its default gateway
How they get their IP addresses is up to you, with 2 machines the
easiest
is to pick some yourself and assign them. If they are not connected to
the internet then you can pick anything you like but they probably
should
be from the non-routable sets (see below). If you have a few machines
you
could use DHCP to allocate auto-magically at boot time.
from rfc 1918….
3. Private Address Space
The Internet Assigned Numbers Authority (IANA) has reserved the
following three blocks of the IP address space for
private internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
Subscribe via RSS