Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 13

IP Sub-Networking Mini-Howto

Robert Hart, hartr@interweft.com.au


v1.0, 31 1997

IP - , C
.
1.
GNU Public License
(GPL).

InterWeft (, ).
InterWeft
WWW site InterWeft IT Consultants <http://www.interweft.com.au/>
The Linux Documentation Project
<http://sunsite.unc.edu/LDP>.
2.
IP
,
, .
IP
.
IP C -
A .
2.1.


IP. :
The Linux Network Administrators Guide
<http://sunsite.unc.edu/LDP/LDP/nag/nag.html>.
The Linux System Administration Guide
<http://linuxwww.db.erau.edu/SAG/>.
TCP/IP Network Administration Craig Hunt, O'Reilly and
Associates <http://www.ora.com/catalog/tcp/noframes.html>.
3. IP
(sub-networking) ,
IP.

3.1. IP interface - host!


', -
IP host. IP
interface host.
- ?
( ) IP
interface ( IP
), .
(
) interface - interface
IP.
6 interface ( router) 6 IP- interface
. '
IP!
' , host
IP. ,
IP interface host.
( ) Internet
interface IP.
3.2. IP " "
(IPv4) IP,
4 byte (1 byte=8 bit) - 32 bit
.
( ).
( ) IP
' ' ('dotted quad'). P

192.168.1.24

- 4 ()
(.) .
4
byte 8 bit, 4 0
255 ( 256 - , 0
).

, IP host
host , 'bit' IP
host (... - interface ).
bit ID
host (interface)
'' ('class') .
3.3. IP
IP
IP 8 bit
( ) ,
24 bit ( )
host interface .
A bit
byte - 0
127 . 128
1 ,
33,554,430 interface.
, 0.0.0.0 ( default
route) 127.0.0.0 ( - loop back network)

. 126
.
IP 16 bit
( ) ,
16 bit ( )
host interface.
2 bit byte 1 0. 14 bit
32767
. ' 2 128
191 ,
32,766 interface.
IP C 24 bit
( bytes) ,
8 bit ( byte) host
interface. C
3 bit 1 1 0 192
255 .
4,194,303 IP C,
254 interface. ( C byte
223 ).
:


A (1)
B (2)
C (3)

1 byte ()
1 126
128 191
192 254

'
' - IP
Internet, :

10.0.0.0
16 B
172.16.0.0 - 172.31.0.0
256 C
192.168.0.0 - 192.168.255.0

''
host.
3.4. , interface,
(broadcast addresses)
IP :
IP ( IP
- ..
Ethernet).
interface (host) bit 0 (
- );
/ (broadcast) IP
( '', ,
IP).
interface (host) bit
1 ( - , ).
interface ( Ethernet PPP
interface host, , .).
host bit
1 - host bit ,
host bit 1
/.

...
( byte
byte host)

10.0.0.0 , host
bit , 0
10.0.1.0 host
10.255.255.255.255 / (broadcast)
host bit 1

...
( byte byte
host)
172.17.0.0
172.17.0.1 host
172.17.255.255 /
C...
( byte byte
host)
192.168.3.0 C
192.168.3.42 host
192.168.3.255 /

IP
C.
3.5. (network mask)
(subnetwork mask).
, .

IP, , IP, ,
( ) - .
(-) bit
'1' host bit '0'.
:
: 255.0.0.0
: 255.255.0.0
C: 255.255.255.0

:

IP ( ,
);
IP -
IP.
4. ;

IP
IP

. , IP
.
:
-
IP, -
IP. - -
.
5. ;
-
IP - site
, host.
,
IP computer site
:
( )
( ).
-: IP
A, ,
( ) .
.
, -
. ,
Ethernet, Token Ring, FDDI, ATM .
- ' !
: site
( )
, . -
, IP,
IP.
ISPs,
,
, IP.
,
. ,
,
, -

bandwidth ()

-

""
. -
/
(R & D) (
)!
,
(
).
6. IP

IP , ;
, : (
- .
/ ,
.. IP
.
.
interface IP
.
(routes)
(gateways),
.
, !
,
- C: 192.168.1.0
254 interface (host),
(192.168.1.0)
(broadcast address) (192.168.1.255).
6.1.

,
.

(, (media converters)
.).


.
/ .
Usenet news
groups ( comp.os.linux.networking).
6.2.

'' IP.
IP
interface (host)- IP
/. ,
, IP
-
IP
.
, , IP ,
' ' interface (host);
4
interface (host) ...
, 4
IP:
IP interface - interface
host
.
.
/.

! host ,
. ,

-.
, IP ,
2^n ( n bit
IP ) .
,

, !

6.3.

IP .
- IP
'bit
' '1' host bit '0'.
, IP,
:
A (8 bit ): 255.0.0.0
B (16 bit ): 255.255.0.0
C (24 bit ): 255.255.255.0
- ,
bit interface
bit network bit. ,
,
host bit bit
() host bit '1'.
C,

11111111.11111111.11111111.10000000
255.255.255.128
C 192.168.1.0,
- :-

______________________________________________________________________
No of
No of
subnets
Hosts/net
netmask
2
126
255.255.255.128 (11111111.11111111.11111111.10000000)
4
62
255.255.255.192 (11111111.11111111.11111111.11000000)
8
30
255.255.255.224 (11111111.11111111.11111111.11100000)
16
14
255.255.255.240 (11111111.11111111.11111111.11110000)
32
6
255.255.255.248 (11111111.11111111.11111111.11111000)
64
2
255.255.255.252 (11111111.11111111.11111111.11111100)
______________________________________________________________________

,
, bit
bit host .
, ' , IP
!
,
IP,
(
,
).
,

/ - IP
. , IP C
( host) :
______________________________________________________________________
Netmask
Subnets Network B'cast MinIP MaxIP Hosts Total Hosts
-------------------------------------------------------------------------128
2
0
127
1
126
126
128
255
129
254
126
252
192

224

0
64
128
192

63
127
191
255

1
65
129
193

62
126
190
254

62
62
62
62

248

0
31
1
30
30
32
63
33
62
30
64
95
65
94
30
96
127
97
126
30
128
159
129
158
30
160
191
161
190
30
192
223
193
222
30
224
255
225
254
30
240
______________________________________________________________________

,
, .
' ' - ,
host ,
.
,
IP host .
7.
/ Linux
( ),
IP (IP Forwarding) .

______________________________________________________________________
cat /proc/ksyms | grep ip_forward
______________________________________________________________________

...
______________________________________________________________________
00141364 ip_forward_Rf71ac834
______________________________________________________________________

, IP (IP-Forwarding)

.
,
C 192.168.1.0 4
( 62 interface/host
IP). ,
, .
:______________________________________________________________________
Network
Broadcast
Netmask
Hosts
192.168.1.0
192.168.1.63
255.255.255.192
62
192.168.1.64
192.168.1.127 255.255.255.192
62
182.168.1.128 192.168.1.255 255.255.255.126
124 ( )
______________________________________________________________________

: 124
( 126
)
'-' . Host
192.168.1.192
'-' . , 192.168.1.191
/ '-' .
, 192.168.1.191 192 host
,
.
-

.

7.1. (routing tables)


Linux router
. interface LANs
interface Internet (
).
Linux
IP interface
. interface :
______________________________________________________________________
Interface
IP Address
Netmask
eth0
192.168.1.1
255.255.255.192
eth1
192.168.1.65
255.255.255.192
eth2
192.168.1.129 255.255.255.128
______________________________________________________________________

:
______________________________________________________________________
Destination
Gateway
Genmask
Interface
192.168.1.0
0.0.0.0
255.255.255.192 eth0
192.168.1.64
0.0.0.0
255.255.255.192 eth1
192.168.1.128 0.0.0.0
255.255.255.128 eth2
______________________________________________________________________

' , host
IP (
). host Linux PC
/ (gateway/router), IP
interface Linux ' .

, , ,
HOWTO, email :
voulariba@hellug.gr : evris@hellug.gr
: ep@rocketmail.com
Robert Hart , 1997.

You might also like