219 lines
5.2 KiB
HTML
219 lines
5.2 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Assigning IP Addresses</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="Setting the Hostname"
|
|
HREF="x-087-2-iface.hostname.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Creating Subnets"
|
|
HREF="x-087-2-create.subnets.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.hostname.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-create.subnets.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="X-087-2-IFACE.ADDRESSES"
|
|
>5.4. Assigning IP Addresses</A
|
|
></H1
|
|
><P
|
|
>If you configure the networking software on your host for standalone
|
|
operation (for instance, to be able to run the INN Netnews software),
|
|
you can safely skip this section, because the only IP address
|
|
you will need is for the loopback interface, which is always
|
|
<SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>127.0.0.1</SPAN
|
|
>.</P
|
|
><P
|
|
>Things are a little more complicated with real networks like Ethernets.
|
|
If you want to connect your host to an existing network, you have to ask
|
|
its administrators to give you an IP address on this network. When
|
|
setting up a network all by yourself, you have to assign IP addresses
|
|
yourself.</P
|
|
><P
|
|
>Hosts within a local network should usually share addresses from the
|
|
same logical IP network. Hence, you have to assign an IP network address.
|
|
If you have several physical networks, you have to either assign them
|
|
different network numbers, or use subnetting to split your IP address
|
|
range into several subnetworks. Subnetting will be revisited in the
|
|
next section, <A
|
|
HREF="x-087-2-create.subnets.html"
|
|
>Section 5.5</A
|
|
>.”</P
|
|
><P
|
|
>When picking an IP network number, much depends on whether you intend
|
|
to get on the Internet in the near future. If so, you should obtain an
|
|
official IP address <I
|
|
CLASS="EMPHASIS"
|
|
>now</I
|
|
>. Ask your network service
|
|
provider to help you. If you want to obtain a network number, just in
|
|
case you might get on the Internet someday, request a Network Address
|
|
Application Form from <SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>hostmaster@internic.net</SPAN
|
|
>, or your
|
|
country's own Network Information Center, if there is one.</P
|
|
><P
|
|
>If your network is not connected to the Internet and won't be in the
|
|
near future, you are free to choose any legal network address. Just
|
|
make sure no packets from your internal network escape to the real
|
|
Internet. To make sure no harm can be done even if packets
|
|
<I
|
|
CLASS="EMPHASIS"
|
|
>did</I
|
|
> escape, you should use one of the network
|
|
numbers reserved for private use. The Internet Assigned Numbers
|
|
Authority (IANA) has set aside several network numbers from classes A,
|
|
B, and C that you can use without registering. These addresses are
|
|
valid only within your private network and are not routed between real
|
|
Internet sites. The numbers are defined by RFC 1597 and are listed in
|
|
<A
|
|
HREF="x-087-2-issues.ip-addresses.html#X-087-2-ISSUES.RESERVED.ADDRESSES"
|
|
>Table 2-1</A
|
|
> in <A
|
|
HREF="x-087-2-issues.html"
|
|
>Chapter 2</A
|
|
>. Note that the second and third blocks
|
|
contain 16 and 256 networks, respectively.</P
|
|
><P
|
|
>Picking your addresses from one of these network numbers is not
|
|
only useful for networks completely unconnected to the Internet; you can
|
|
still implement a slightly more restricted access using a single
|
|
host as a gateway. To your local network, the gateway is accessible by its
|
|
internal IP address, while the outside world knows it by an officially
|
|
registered address (assigned to you by your provider). We come back to
|
|
this concept in connection with the IP masquerade facility in
|
|
<A
|
|
HREF="x-087-2-ipmasq.html"
|
|
>Chapter 11</A
|
|
>.</P
|
|
><P
|
|
>Throughout the remainder of the book, we will assume that the brewery's
|
|
network manager uses a class B network number, say
|
|
<SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>172.16.0.0</SPAN
|
|
>. Of course, a class C
|
|
network number would definitely suffice to accommodate both the Brewery's and
|
|
the Winery's networks. We'll use a class B network here for the sake of
|
|
simplicity; it will make the subnetting examples in the next section
|
|
of this chapter a little more intuitive.</P
|
|
></DIV
|
|
><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.hostname.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-create.subnets.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Setting the Hostname</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"
|
|
>Creating Subnets</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |