old-www/LDP/nag2/x-087-2-create.subnets.html

220 lines
4.0 KiB
HTML

<HTML
><HEAD
><TITLE
>Creating Subnets</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux Network Administrators Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Configuring TCP/IP Networking"
HREF="x-087-2-iface.html"><LINK
REL="PREVIOUS"
TITLE="Assigning IP Addresses"
HREF="x-087-2-iface.addresses.html"><LINK
REL="NEXT"
TITLE="Writing hosts and networks Files"
HREF="x-087-2-iface.simple-resolv.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Network Administrators Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x-087-2-iface.addresses.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 5. Configuring TCP/IP Networking</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x-087-2-iface.simple-resolv.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="X-087-2-CREATE.SUBNETS"
>5.5. Creating Subnets</A
></H1
><P
>To operate several Ethernets (or other networks, once a driver is
available), you have to split your network into subnets. Note that
subnetting is required only if you have more than one
<I
CLASS="EMPHASIS"
>broadcast network</I
>&#8212;point-to-point links
don't count. For instance, if you have one Ethernet, and one or more
SLIP links to the outside world, you don't need to subnet your
network. This is explained in more detail in <A
HREF="x-087-2-slip.html"
>Chapter 7</A
>.</P
><P
>To accommodate the two Ethernets, the Brewery's network manager decides
to use 8 bits of the host part as additional subnet bits. This
leaves another 8 bits for the host part, allowing for 254 hosts on
each of the subnets. She then assigns subnet number 1 to the brewery,
and gives the winery number 2. Their respective network addresses are
thus <SPAN
CLASS="SYSTEMITEM"
>172.16.1.0</SPAN
> and
<SPAN
CLASS="SYSTEMITEM"
>172.16.2.0</SPAN
>. The subnet mask is
<SPAN
CLASS="SYSTEMITEM"
>255.255.255.0</SPAN
>.</P
><P
><SPAN
CLASS="SYSTEMITEM"
>vlager</SPAN
>, which is the gateway between
the two networks, is assigned a host number of 1 on both of them, which gives
it the IP addresses <SPAN
CLASS="SYSTEMITEM"
>172.16.1.1</SPAN
> and
<SPAN
CLASS="SYSTEMITEM"
>172.16.2.1</SPAN
>, respectively.</P
><P
>Note that in this example we are using a class B network to keep things
simple, but a class C network would be more realistic. With the new networking
code, subnetting is not limited to byte boundaries, so even a class C
network may be split into several subnets. For instance, you could use two
bits of the host part for the netmask, giving you 4 possible subnets
with 64 hosts on each.<A
NAME="X-087-2-FNTC02"
HREF="#FTN.X-087-2-FNTC02"
>[1]</A
></P
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNTC02"
HREF="x-087-2-create.subnets.html#X-087-2-FNTC02"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>The first number on each subnet is the subnetwork address, and the last number
on each subnet is reserved as the broadcast address, so it's actually 62 hosts
per subnet.</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x-087-2-iface.addresses.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x-087-2-iface.simple-resolv.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Assigning IP Addresses</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x-087-2-iface.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Writing hosts and networks Files</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>