Академический Документы
Профессиональный Документы
Культура Документы
3
..........................................................................................................................................3
IPv4.........................................................................................................................3
IP;................................................................................................3
(8 bit).....................................................................4
(8 bit).....................................................................4
BIN DEC (8bit).....................................................5
() - ...................................................................................5
() IP;....................6
IP;....................................................................................................7
IP.............................................................................................................7
IP............................................................................................................8
...........................................................................................................................8
A, B, C......................................................................9
.....................................................................................................................9
.............................................................................................................................11
(CIDR) ...................................................................15
TCP/IP. , .........................................17
..............................................................................................17
..................................................................................................19
. ;......................................................................................19
MS Windows (XP SP2+)......................................................................................................20
Linux (unix, xxxxBSD, Mac OS X, ...)................................................................................22
() Ubuntu 9.10 (NetworkManager)
GNOME....................................................................................22
() Ubuntu 9.10 (
NetworkManager)............................................................................................................24
ifconfig.................................................................................................................................25
ifconfig..........................................................................................25
...................................................................................................................................27
...................................................................28
ping.......................................................................................................................................28
traceroute..............................................................................................................................31
nslookup...............................................................................................................................33
route......................................................................................................................................34
netstat....................................................................................................................................36
arp.........................................................................................................................................38
(man pages)....................................................................................39
Windows...........................................................................39
....................................................................................................41
md5sum ...............................................................................................................................42
...................................................................................................................................43
.........................................................................................................................44
/ ...............................................................................45
GnuPG (GNU Privacy Guard GNU [GnuPG-1])...........................45
gpg.......................................................................................................................................46
(/)..........................................................46
...............................................................................................48
TCP/IP by SV2DOF, . 1 / 48
TCP/IP by SV2DOF, . 2 / 48
TCP/IP (IPv4)
, ( )
,
,
, .
IPv4
IP1 2 ,
( 4 - IPv4), 32
, IP (IP Address).
.. 11000000101010000000000100010010
IP;
, ,
:
byte
11000000101010000000000100010010
192.168.1.18 (fourpart dotted decimal notation)
IP :
1.
2. 0 255 (
byte,
0 28 1 )
IP:
/
1
2
/ ;
192.168.1.12
10.0.0.12.3
172.16.257.3
(257) 0 255
10.146.0.1
194.219.227.3
127.270.0.1
IP Internet
,
.
,
.
IP (Network Interface) .
Ethernet ( ) .
TCP/IP by SV2DOF, . 3 / 48
(8 bit)
(2 )
( 0, ).
5 b5, 25 = 32.
128
64
32
16
b7
b6
b5
b4
b3
b2
b1
b0
, 128+32+8 = 168.
(10101000)2 = (168)10
:
(1100 0000)2 = 128+64 = (192)10
(1001 0010)2 = 128+16+2 = (146)10
(8 bit)
(207)10
1.
207 128
2.
77 64
3.
, 5-4 =1 1 b2
1 2
8.
, 13-8 =5 1 b3
5 4
7.
, 0 b4
13 8
6.
, 0 b5
13 16
5.
, 77-64 =13 1 b6
13 32
4.
, 207-128 =77 1 b7
, 0 b1
1 1
, 1-1 =0 1 b0
128
64
32
16
b7
b6
b5
b4
b3
b2
b1
b0
TCP/IP by SV2DOF, . 4 / 48
128
64
32
16
b7
b6
b5
b4
b3
b2
b1
b0
128
64
32
16
b7
b6
b5
b4
b3
b2
b1
b0
() -
IP .
(Network ID) (prefix)
(Host ID) (suffix) .
.
192.168.1.12 , 192.168.1
192.168.1.0 (12) 12 .
192.
168.
1.
12
(network)
(Host)
1: IP
. ,
8bit, 28 = 256 (0-255,
0 255 , 1 254,
. 254 ).
254
(byte) . 216 = 65536
3
( 65534 )
, 24 bit .
32 bit.
-
- -.
IP 4
0
n (7bit)
10
110
27 =
128
224-2 =
16 777 214
214 =
16 384
216-2 =
65 534
221 =
2 097 152
28-2 =
254
n (6bit)
n (5bit)
2:
() IP;
IP, ,
(byte) (2 3), :
0xxx xxxx
0000 0000
0111 1111
127
x :01
10xx xxxx
1000 0000
1011 1111
128
191
110x xxxx
1100 0000
1101 1111
192
223
1110 xxxx
1110 0000
1110 1111
224
239
Multicast4
1111 0xxx
1111 0000
1111 0111
240
247
3: IP
, A, B C
. D E .
IP :
254 .
.
Multicast =
TCP/IP by SV2DOF, . 6 / 48
IP
192.168.1.12
10.146.0.1
10 0 .. 127
172.16.32.253
127.0.0.1
127 0 .. 127
194.219.227.1
:
IP
_3
3 (1 ) 2,
() 2.
IP;
IP ,
(IANA/ICANN) (RIR
Regional Internet Registry) (LIR Local Internet Registry)
IP
,
Internet, IP
.
IP.
RFC1918 - Address Allocation for Private Internets6
:
5
6
http://www.ripe.net/membership/indices/GR.html
http://tools.ietf.org/html/rfc1918
TCP/IP by SV2DOF, . 7 / 48
CIDR7
10.0.0.0
10.255.255.255
10/8
172.16.0.0
172.31.255.255
172.16/12
192.168.0.0
192.168.255.255
192.168/16
4: IP,
, IP,
4 .
Internet.
RFC (Request For Comments) IETF (Internet Engineering Task Force)
( ) , ,
Internet .
Internet.
IP
55
TCP/IP. , C, .. 194.219.227.0
254 . ,
194.219.227.1 194.219.227.55 ,
.
250
. ,
.. 300. B
65000 .
IP ( B)
,
. ,
. IP ,
(CIDR) [RFC1519, RFC4632].
32 , IP
(Net ID - prefix)
(Host ID - suffix) .
(1)
(0)
.
(-)
TCP/IP by SV2DOF, . 8 / 48
( )
192.
168.
1.
18
IP:
1100 0000
1010 1000
0000 0001
0001 0010
1111 1111
1111 1111
1111 1111
0000 0000
255.
255.
255.
( )
IP -
(1) ,
(0)
8.
(AND), (bitwise), IP
IP.
IP: 1100 0000 1010 1000 0000 0001 0001 0010 192.168.
1.18
AND
1. 0
4: ( IP) AND ( ) =
A, B, C
,
() (Net ID Host ID) 2,
5
CIDR
0xxx xxxx
127
255.0.0.0
/8
10xx xxxx
128
191
255.255.0.0
/16
110x xxxx
192
223
255.255.255.0
/24
x :01
5: A, B, C
CIDR. IP
(prefix), .. 192.168.1.12 / 24
: IP,
( )
AND IP .
8
http://support.microsoft.com/kb/220874
TCP/IP by SV2DOF, . 10 / 48
, .
:
IP. .. B 65534
8
' 8190 .
. C, ,
. ,
.
:
1. n m ,
(Host ID)
(Net ID).
2. (-)
.
192.168.3.0/24 255.255.255.0
192.168.3.0/24
<Net_ID>,<Host_ID> 24,8 .
<Net_ID>,<Subnet_ID>,<Host_ID> Net_ID: 24bit Subnet_ID +Host_ID: 8bit
Subnet_ID 6 ,
, 3bit.
21
16
32
64
128
256
3
4
5
6
7
8
6:
TCP/IP by SV2DOF, . 11 / 48
192
168
255
255
255
11111111
11111111
11111111
00000000
11111111
11111111
11111111
11100000
255
255
255
224
255.255.255.224
192.168.3.0/27
<Net_ID>,<Subnet_ID>,<Host_ID> Net_ID: 24bit, Subnet_ID: 3bit, Host_ID: 5bit
. ,
(2n).
:
/
0
1
2
3
4
5
6
7
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
11000000
10101000
00000011
4
000
001
010
011
100
101
110
111
00000
192.168.3.0
11111
192.168.3.31
00000
192.168.3.32
11111
192.168.3.63
00000
192.168.3.64
11111
192.168.3.95
00000
192.168.3.96
11111
192.168.3.127
00000
192.168.3.128
11111
192.168.3.159
00000
192.168.3.160
11111
192.168.3.191
00000
192.168.3.192
11111
192.168.3.223
00000
192.168.3.224
11111
192.168.3.255
/ ( 0,
Subnet_ID).
(Net_ID)
(Subnet_ID).
TCP/IP by SV2DOF, . 12 / 48
192.168.3.0 192.168.3.31
. , 192.168.3.0,
, 192.168.3.31 /.
192.168.3.1
192.168.3.30, (30).
.
: C 254
. 254 . , (8)
, 8 x 30 = 240 , 14 .
.
192.168.17.0/24 255.255.255.0
50
192
168
17
255
255
255
11111111
11111111
11111111
00000000
11111111
11111111
11111111
11000000
255
255
255
192
255.255.255.192
192.168.17.0/26
<Net_ID>,<Subnet_ID>,<Host_ID> Net_ID: 24bit, Subnet_ID: 2bit, Host_ID: 6bit
7
, , /
( 0,
Subnet_ID).
(Net_ID) (Subnet_ID).
TCP/IP by SV2DOF, . 13 / 48
/
0
1
2
3
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
11000000
10101000
00010001
4
00
01
10
11
000000
192.168.3.0
111111
192.168.3.63
000000
192.168.3.64
111111 192.168.3.127
000000 192.168.3.128
111111 192.168.3.191
000000 192.168.3.192
111111 192.168.3.255
7: 192.168.17.0 / 255.255.255.192
192.168.17.0 192.168.17.63 . ,
192.168.17.0, ,
192.168.17.63 /.
22 = 4
192.168.3.1
192.168.3.62, (62).
.
: C 254
. 254 . , (4)
, 4 x 62 = 248 , 6 .
,
,
.
172.25.0.0/16 255.255.0.0
24
(4) .
TCP/IP by SV2DOF, . 14 / 48
(CIDR10)
IP , /
, ,
.
IPv4.
IPv4 /.
.. (~1000 )
B, ~64000 , C.
, (22 = 4)
(Net_ID) (Host_ID)
255.255.252.0 (11111111.11111111.11111100.00000000)
, (Host_ID)
(Net_ID) Subnet_ID. , (Net_ID)
(Host_ID), .
( )
.. 192.168.128.0/22 255.255.252.0
192.168.128.0 192.168.131.255
11000000
10101000
3
100000
00
00000000
192.168.128.0
11
11111111
192.168.131.255
. 192.168.128.0/22
; (, Host_ID
Host_ID . .)
TCP/IP by SV2DOF, . 16 / 48
TCP/IP. , .
TCP/IP
,
( IP, ...)
,
(ping, traceroute ...)
,
,
(clients) /
(telnet), (ftp), DNS (nslookup) .
,
DOS/WINDOWS (.. bash shell) unix/linux/Mac OS X.
.. (GUI)
.
,
( , )
. ,
.
..
Windows11
:
Microsoft Windows XP [ 5.1.2600]
(C) 1985-2001 Microsoft Corporation
C:\>ipconfig
IP Windows
Ethernet :
DNS .
IP. . . . . . . . .
. . . . . . .
. . . . . .
.
.
.
.
:
: 10.0.2.15
: 255.255.255.0
: 10.0.2.2
C:\>
11 Windows XP SP2.
.
TCP/IP by SV2DOF, . 17 / 48
/all
.
' linux, :
george@perseus:~$ /sbin/ifconfig
eth0
Link encap:Ethernet HWaddr 00:19:d1:60:cb:f8
inet addr:192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe60:cbf8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30276043 errors:0 dropped:0 overruns:0 frame:0
TX packets:32395459 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:422044918 (422.0 MB) TX bytes:254501053 (254.5 MB)
Memory:e8300000-e8320000
lo
Genmask
255.255.255.0
255.255.0.0
0.0.0.0
Flags
U
U
UG
MSS
0
0
0
Window
0
0
0
irtt
0
0
0
Iface
eth0
eth0
eth0
12 netstat -r windows
TCP/IP by SV2DOF, . 18 / 48
george@perseus:~$
DNS
george@perseus:~$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 193.92.150.3
nameserver 194.219.227.1
george@perseus:~$
,
/, DHCP13
.
, , (router)
Internet, DHCP,
.
DHCP
(Administrator Windows root
sudo linux)
. ;
1. IP ( IP Address, inet addr)
13 DHCP: Dynamic Host Configuration Protocol. http://el.wikipedia.org/wiki/DHCP
TCP/IP by SV2DOF, . 19 / 48
Internet (TCP/IP)
TCP/IP by SV2DOF, . 21 / 48
. !!!
, , .
ipconfig /all
( )
NetworkManager ...
TCP/IP by SV2DOF, . 22 / 48
Auto eth015
IPv4 :
.
, , .
, .
15 Auto eth0 eth0 (Auto) .
TCP/IP by SV2DOF, . 23 / 48
() Ubuntu 9.10 (
NetworkManager)
, GUI,
/etc/network/interfaces
(editor) vi
, sudo vi /etc/network/interfaces
george@2epalx:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.61
netmask 255.255.255.0
gateway 192.168.1.1
# This PC has a second Ethernet NIC
auto eth1
iface eth1 inet dhcp
george@2epalx:~$
,
,
sudo /etc/init.d/networking restart
man interfaces
DNS /etc/resolv.conf
nameserver IP DNS
george@2epalx:~$ cat /etc/resolv.conf
domain domain_not_set.invalid
search domain_not_set.invalid
nameserver 193.92.150.3
nameserver 193.92.3.11
nameserver 192.168.1.1
george@2epalx:~$
ifconfig
ifconfig
unix (linux, FreeBSD, Mac OS X, Solaris, ).
( ).
.
( root
sudo)
ifconfig
man ifconfig
ifconfig
(UP)
/sbin/ifconfig
,
(DOWN)
/sbin/ifconfig -a
eth0
/sbin/ifconfig eth0
IP eth0 192.168.1.141
/sbin/ifconfig eth0 192.168.1.141
eth0 255.255.255.192
/sbin/ifconfig eth0 netmask 255.255.255.192
eth1
/sbin/ifconfig eth1 down
eth1
/sbin/ifconfig eth1 up
TCP/IP by SV2DOF, . 25 / 48
en1: 1
mtu, ( ) 1500 bytes
inet, internet (IP, -3 ) 192.168.1.67,
netmask, 0xffffff00 (=255.255.255.0)
broadcast, 192.168.1.255
ether, ethernet (-2 ) 00:0d:93:89:18:ca
ifconfig eth0
ubuntu 9.10
george@perseus:~$ /sbin/ifconfig eth0
eth0
Link encap:Ethernet HWaddr 00:19:d1:60:cb:f8
inet addr:192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe60:cbf8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41996116 errors:0 dropped:0 overruns:0 frame:0
TX packets:44857768 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:264483578 (264.4 MB) TX bytes:1320620722 (1.3 GB)
Memory:e8300000-e8320000
george@perseus:~$
eth0, eth 0
Link encap: 2 (data link) ethernet
HWaddr: (-2 ) ethernet 00:19:d1:60:cb:f8
TCP/IP by SV2DOF, . 26 / 48
1. ,
i.
Ethernet, hub
switch
ii.
IP, .
(:
RJ-45 (modular jack/plug 8p8c) ( /)
( ). UTP/FTP
hub switch. .
windows ipconfig /all
linux, /sbin/ifconfig)
.
2. ,
i.
IP 192.168.7.12 ( , )
ii.
255.255.255.192
iii. 192.168.1.3
( .. , )
TCP/IP by SV2DOF, . 27 / 48
ping
(network
interface) ,
ping. ,
IP . ()
.
ping (
) ICMP ECHO_REQUEST
ECHO_REPLY.
ping,
(3 OSI)
ping .. linux
george@perseus:~$ /bin/ping 192.168.1.65
PING 192.168.1.65 (192.168.1.65) 56(84) bytes of data.
64 bytes from 192.168.1.65: icmp_seq=1 ttl=254 time=7.68 ms
64 bytes from 192.168.1.65: icmp_seq=2 ttl=254 time=0.648 ms
64 bytes from 192.168.1.65: icmp_seq=3 ttl=254 time=0.686 ms
64 bytes from 192.168.1.65: icmp_seq=4 ttl=254 time=0.657 ms
64 bytes from 192.168.1.65: icmp_seq=5 ttl=254 time=0.677 ms
64 bytes from 192.168.1.65: icmp_seq=6 ttl=254 time=0.642 ms
64 bytes from 192.168.1.65: icmp_seq=7 ttl=254 time=0.700 ms
^C
--- 192.168.1.65 ping statistics --7 packets transmitted, 7 received, 0% packet loss, time 5998ms
rtt min/avg/max/mdev = 0.642/1.670/7.684/2.455 ms
george@perseus:~$
64 byte IP 192.168.1.65
icmp_seq=3 ..., ttl (Time To Live)
(hop) time
( ms) (round trip time).
ping. 7 , 7, 0% ,
6 (5998 ms).
(rtt ms): 0.642, 7.684 1.670
2.455
linux ( .. unix) ping <>,
, <Ctrl>+<C>
windows 16 .
ping .. windows
16 , linux, C:\>ping -t <>
TCP/IP by SV2DOF, . 28 / 48
C:\>ping 192.168.1.65
Ping 192.168.1.65 32 bytes :
:
:
:
:
192.168.1.65:
192.168.1.65:
192.168.1.65:
192.168.1.65:
bytes=32
bytes=32
bytes=32
bytes=32
=518ms TTL=127
=36ms TTL=127
=516ms TTL=127
=15ms TTL=127
Ping 192.168.1.65:
: = 4, = 4, = 0 ( 0%),
:
= 15ms, = 518ms, = 271ms
C:\>
DNS ,
<> (FQDN) IP, ..
george@perseus:~$ /bin/ping www.sch.gr
PING www.sch.gr (194.63.238.40) 56(84) bytes of data.
64 bytes from www.sch.gr (194.63.238.40): icmp_seq=1 ttl=49 time=21.6 ms
64 bytes from www.sch.gr (194.63.238.40): icmp_seq=2 ttl=49 time=21.4 ms
64 bytes from www.sch.gr (194.63.238.40): icmp_seq=3 ttl=49 time=21.0 ms
^C
--- www.sch.gr ping statistics --3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 21.098/21.413/21.699/0.246 ms
george@perseus:~$ ^C
george@perseus:~$
ping
*** 10 128 byte
linux
george@perseus:~$ /bin/ping -c 10 -s 128 192.168.1.65
136 bytes
windows
C:\>ping -n 10 -l 128 192.168.1.65
*** 2 ttl=717 www.sch.gr
linux
george@perseus:~$ ping -t 7 -c 2 www.sch.gr
PING www.sch.gr (194.63.238.40) 56(84) bytes of data.
From clientRouter.sch.koletti1.access-link.grnet.gr (195.251.24.53) icmp_seq=1
Time to live exceeded
From clientRouter.sch.koletti1.access-link.grnet.gr (195.251.24.53) icmp_seq=2
Time to live exceeded
--- www.sch.gr ping statistics --17 . ( TTL)
traceroute
TCP/IP by SV2DOF, . 29 / 48
PING(8)
NAME
ping, ping6 - send ICMP ECHO_REQUEST to network hosts
SYNOPSIS
ping [-LRUbdfnqrvVaAB] [-c count] [-i interval] [-l preload] [-p pat
tern] [-s packetsize] [-t ttl] [-w deadline] [-F flowlabel] [-I inter
face] [-M hint] [-Q tos] [-S sndbuf] [-T timestamp option] [-W timeout]
[hop ...] destination
DESCRIPTION
ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit
an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams
(``pings'') have an IP and ICMP header, followed by a struct timeval
and then an arbitrary number of ``pad'' bytes used to fill out the
packet.
OPTIONS
-a
Audible ping.
-A
windows,
C:\>ping /?
: ping [-t] [-a] [-n ] [-l ] [-f] [-i TTL] [-v TOS]
[-r ] [-s ] [[-j ] | [-k ]]
[-w -] -
:
-t
-a
-n
-l
-f
-i
-v
-r
-s
-j
-k
-w
Ping .
Control-Break. Control-C.
.
buffer.
(fragment) .
TTL
(Time To Live).
TOS
(Type Of Service).
.
- millisecond.
C:\>
traceroute18
traceroute (tracert windows)
( ) .
ttl=1, ttl=2, ... max
linux
george@perseus:~$ traceroute www.raag.org
traceroute to www.raag.org (69.10.157.105), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 1.002 ms 1.352 ms 1.706 ms
2 * * *
3 core-ath-03-Po1.forthnet.gr (212.251.60.62) 27.130 ms 28.590 ms 30.565 ms
4 core-kln-01-Gi4-0-0.forthnet.gr (212.251.94.62) 40.328 ms 41.711 ms
44.629 ms
5 core-lsf-03G3-0-0.forthnet.gr (212.251.94.18) 46.612 ms 48.481 ms 50.416
ms
6 xe-8-0-0.fra23.ip4.tinet.net (77.67.74.173) 92.158 ms 63.945 ms 89.040 ms
7 xe-6-1-0.sea11.ip4.tinet.net (89.149.187.221) 262.481 ms 265.043 ms
264.053 ms
8 rackforce-networks-gw.ip4.tinet.net (77.67.70.22) 275.480 ms 278.299 ms
282.785 ms
9 e1-1-cr1.g2.kelowna.rackforce.net (64.46.60.18) 285.155 ms 284.740 ms
289.316 ms
10 e7-8-cr1.g2.kelowna.rackforce.net (64.46.60.66) 297.981 ms 299.580 ms
301.526 ms
11 quad.lighthouse.gr (69.10.157.105) 300.632 ms 304.207 ms 308.087 ms
george@perseus:~$
18 Ubuntu . sudo apt-get install traceroute
TCP/IP by SV2DOF, . 31 / 48
windows
C:\>tracert www.raag.org
: quad-web.lighthouse.gr [69.10.157.105]
30:
1
2
3
4
5
2
500
*
496
499
ms
ms
ms
ms
ms
ms
9
2
*
22
93
6
7
8
9
505
503
593
497
ms
ms
ms
ms
<1
4
*
45
24
ms
ms
10.0.2.2
192.168.1.1
.
core-ath-03-Po1.forthnet.gr [212.251.60.62]
core-kln-01-Gi4-0-0.forthnet.gr [212.251.94.62]
ms
ms
ms
ms
363
76
240
248
ms
ms
ms
ms
105
412
237
241
ms
ms
ms
ms
core-lsf-03G3-0-0.forthnet.gr [212.251.94.18]
xe-8-0-0.fra23.ip4.tinet.net [77.67.74.173]
xe-6-1-0.sea11.ip4.tinet.net [89.149.187.221]
rackforce-networks-gw.ip4.tinet.net [77.67.70.22
10
588 ms
245 ms
251 ms
e1-1-cr1.g2.kelowna.rackforce.net [64.46.60.18]
11
500 ms
501 ms
427 ms
e7-8-cr1.g2.kelowna.rackforce.net [64.46.60.66]
12
501 ms
261 ms
254 ms
quad.lighthouse.gr [69.10.157.105]
.
C:\>
30 hops max,
30 (-hops) .
TTL -m .
george@perseus:~$ traceroute -m 60 www.sch.gr
(TTL) (ICMP TIME_EXCEEDED)
(firewall).
'
TCP UDP ( ) ICMP ..
george@perseus:~$ sudo traceroute -T -p 80 www.sch.gr
ping -R <>
.
george@perseus:~$ ping -R -c 1 www.sch.gr
traceroute ,
Ubuntu, , tracepath.
tracert windows .
pathping .
TCP/IP by SV2DOF, . 32 / 48
nslookup
nslookup -
(Domain Name servers) Internet. nslookup,
DNS ( ) ,
IP (FQDN) .
nslookup (DNS servers)
.
interactive mode ( )
.
IP , IP .
exit.
. IP www.sch.gr
george@perseus:~$ nslookup
> www.sch.gr
Server:
193.92.150.3
Address:
193.92.150.3#53
Non-authoritative answer:
Name: www.sch.gr
Address: 194.63.238.40
>
> exit
george@perseus:~$
DNS 193.92.150.3 53
IP www.sch.gr 194.63.238.40 Non-authoritative answer
DNS ( )
(domain) sch.gr /
.
nslookup -querytype=NS sch.gr
( authoritative) DNS (NS) sch.gr '
.
george@perseus:~$ nslookup -querytype=NS sch.gr
Server:
193.92.150.3
Address:
193.92.150.3#53
Non-authoritative answer:
sch.gr
nameserver = nic.grnet.gr.
sch.gr
nameserver = nic.sch.gr.
sch.gr
nameserver = nic.thess.sch.gr.
sch.gr
nameserver = nic.att.sch.gr.
Authoritative answers can be found
nic.grnet.gr
internet address
nic.att.sch.gr
internet address
nic.thess.sch.gr internet address
from:
= 194.177.210.210
= 194.63.239.164
= 194.63.237.4
george@perseus:~$
nic.grnet.gr
TCP/IP by SV2DOF, . 33 / 48
calchas.forthnet.gr
> www.sch.gr
: calchas.forthnet.gr
Address: 193.92.150.3
:
:
www.sch.gr
Address: 194.63.238.40
> exit
C:\>
nslookup, unix, dig (domain
information groper) , batch
mode. DNS.
route
( ) .
linux, , .
george@perseus:~$ route
Kernel IP routing table
Destination
Gateway
Genmask
Flags Metric Ref
Use Iface
192.168.1.0
*
255.255.255.0
U
1
0
0 eth0
192.168.11.0
*
255.255.255.0
U
0
0
0 eth0
link-local
*
255.255.0.0
U
1000
0
0 eth0
default
192.168.1.1
0.0.0.0
UG
0
0
0 eth0
george@perseus:~$
(Destination)
(Iface) (Genmask). U (UP), G
(Gateway) Metric
.
(default gateway) 192.168.1.1
windows PRINT.
TCP/IP by SV2DOF, . 34 / 48
.. windows 7 ultimate
C:\>route PRINT -4
===========================================================================
11...08 00 27 18 82 96 ...... Intel(R) PRO/1000 MT Desktop
1...........................Software Loopback Interface 1
12...00 00 00 00 00 00 00 e0 Microsoft ISATAP
13...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
===========================================================================
IPv4
===========================================================================
:
0.0.0.0
0.0.0.0
10.0.2.2
10.0.2.15
10
10.0.2.0
255.255.255.0
10.0.2.15
266
10.0.2.15 255.255.255.255
10.0.2.15
266
10.0.2.255 255.255.255.255
10.0.2.15
266
127.0.0.0
255.0.0.0
127.0.0.1
306
127.0.0.1 255.255.255.255
127.0.0.1
306
127.255.255.255 255.255.255.255
127.0.0.1
306
224.0.0.0
240.0.0.0
127.0.0.1
306
224.0.0.0
240.0.0.0
10.0.2.15
266
255.255.255.255 255.255.255.255
127.0.0.1
306
255.255.255.255 255.255.255.255
10.0.2.15
266
===========================================================================
:
C:\>
TCP/IP by SV2DOF, . 35 / 48
netstat
netstat
. (sockets) ,
(netstat -r)
(network interfaces). unix,
, .
684
linux torrent client
sockets .
george@perseus:~$ /bin/netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address
Foreign Address
State
tcp
0
69 perseus.local:45114
pool-96-247-199-1:51413 LAST_ACK
tcp
0
0 perseus.local:52642
dsl-hkibrasgw3-ffd:6881 TIME_WAIT
tcp
0
102 perseus.local:36240
cpe-24-24-72-26.st:1134 LAST_ACK
.
tcp
0
197 perseus.local:49738
bl9-99-60.dsl.tel:49040 FIN_WAIT1
.
tcp
0
102 perseus.local:42279
d154-5-38-150.bch:34793 ESTABLISHED
.
udp
0
0 perseus.local:42707
calchas.forthnet:domain ESTABLISHED
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags
Type
State
I-Node
Path
unix 2
[ ]
DGRAM
3383
@/org/kernel/udev/udevd
unix 16
[ ]
DGRAM
4976
/dev/log
unix 2
[ ]
DGRAM
5545
@/org/freedesktop/hal/udev_event
unix 2
[ ]
STREAM
CONNECTED
7469631
.
.
.
unix 3
[ ]
STREAM
CONNECTED
3367
@/com/ubuntu/upstart
unix 3
[ ]
STREAM
CONNECTED
3364
george@perseus:~$
1 (Proto) , 4 5
6 (State) (socket).
.
.. ( ) -a,
-n, tcp -t
george@perseus:~$ netstat -ant
80 tcp ( web)
george@perseus:~$ netstat -ant|grep \:80
, 80 tcp
. ( 6 )
TCP/IP by SV2DOF, . 36 / 48
LISTENING
LISTENING
PID
692
4
ESTABLISHED
TIME_WAIT
ESTABLISHED
328
0
328
1344
1344
C:\>tasklist /svc
PD
========================= ======== ============================================
System Idle Process
0 /
System
4 /
smss.exe
268 /
csrss.exe
344 /
wininit.exe
380 /
.
svchost.exe
1344 FDResPub, SSDPSRV
taskhost.exe
1888 /
taskeng.exe
1928 /
.
firefox.exe
328 /
wmpnetwk.exe
828 WMPNetworkSvc
.
tasklist.exe
2772 /
WmiPrvSE.exe
2832 /
C:\>
(spyware ...) .
TCP/IP by SV2DOF, . 37 / 48
arp
ARP19
IP Ethernet (MAC)
ARP/(RARP) IPv4
ethernet IP .
IP (layer 3) ethernet (MAC) (layer 2)
ARP/RARP (cache) .
( )
arp .
george@perseus:~$ /usr/sbin/arp -n
Address
HWtype HWaddress
Flags Mask
192.168.1.1
ether
00:14:bf:eb:bb:90
C
192.168.1.65
ether
00:04:00:ed:f9:68
C
george@perseus:~$
-n arp DNS
Iface
eth0
eth0
C:\>
arp cache windows 7 ultimate:
> arp -s 157.55.85.212
00-aa-00-62-c6-09 .... .
(man pages)
unix ...
-, , ...
( root) , ,
, ,
..
, , ..
unix (linux, FreeBSD, Mac OS X, Solaris, ...) (manual pages)
$ man _
NAME
SYNOPSIS
,
DESCRIPTION
EXAMPLES
SEE ALSO
space
b
/
?
q
_ j
_ k
n
N
h
g
G
Windows
Windows, ,
( TCP/IP )
(slash) .
C:\>_ /?
help
C:\>help _
windows 7 Windows PowerShell Cmdlet Get-Help
man pages unix. ' , TCP/IP, /?
TCP/IP by SV2DOF, . 39 / 48
TCP/IP by SV2DOF, . 40 / 48
.
, , '
, .
.
.
( ) .
( ) ,
, ""
.
( ) (hash
function) (message digest).
:
() , .. 128bit
, ..
()
,
, .
Thequick
brownfox
jumpsover
thelazydog
MD5
37c4b87e
dffc5d19
8ff5a185
cee7ee09
MD5
/ MD520
128 bit.
linux md5sum .
.. md5 .. unix. windows '
20 RFC1321 - The MD5 Message-Digest Algorithm, http://www.faqs.org/rfcs/rfc1321.html
TCP/IP by SV2DOF, . 41 / 48
. Microsoft
File Checksum Integrity Verifier (FCIV) utility ( http://support.microsoft.com/kb/841290 )
.
md5sum windows (
) ftp://ftp.gnupg.org/gcrypt/binary/
md5sum
md5sum (Message Digest)
128 bit, MD5.
george@perseus:~/dload$ md5sum lucid-dvd-amd64.iso
1f5ef6cb9eb2d20c71413007b477ae47 lucid-dvd-amd64.iso
george@perseus:~/dload$
-c
(message digests), MD5
, .
george@perseus:~/dload$ md5sum -c MD5SUMS
lucid-dvd-amd64.iso:
lucid-dvd-i386.iso:
md5sum: WARNING: 1 of 2 computed checksums did NOT match
george@perseus:~/dload$
/
.
/ ..
DVD, lucid-dvd-amd64.iso 4.418.144.256 byte, P4/3.0GHz,
50 .
MD5SUMS :
george@perseus:~/dload$ cat MD5SUMS
1f5ef6cb9eb2d20c71413007b477ae47 *lucid-dvd-amd64.iso
4bc6827198b3b3825e1db5cb256eeece *lucid-dvd-i386.iso
george@perseus:~/dload$
windows, md5sum, md5sumw32.zip ftp://ftp.gnupg.org/gcrypt/binary/ 21 md5sum.exe
windows Path .. %SystemRoot%\system32;
%SystemRoot%;
.. C:\myutils\
Path ( , , > >
> , Path, >
;C:\myutils\)
21 sha1sum.exe
TCP/IP by SV2DOF, . 42 / 48
md5sum windows XP
md5sum (message
digest) fox.txt
ii.
(hex)
4 bit, bit MD5.
.
; ; MD5;
md5sum;
ii.
TCP/IP by SV2DOF, . 43 / 48
1. (string)
(collision).
.
2.
..
;
..
unix.
TCP/IP by SV2DOF, . 44 / 48
/ .
.
( ).
() .
, ,
(PKI server, ..
http://pgp.mit.edu/ ).
.
gpg
. ()
( ..)
gpg / .
(/)
george@perseus:~$ gpg --gen-key
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
:
(1) DSA and Elgamal (default)
(2) DSA ( )
(5) RSA ( )
;
Enter Return (default) .
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Enter Return
2048 bits
.
0 =
<n> = n
<n>w = n
<n>m = n
<n>y = n
; (0)
Enter Return
Key does not expire at all
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
-
:
Email: a.peleides@iliad.net
: Key for personal use
`utf-8' .
USER-ID:
" (Key for personal use) <a.peleides@iliad.net>"
TCP/IP by SV2DOF, . 46 / 48
ls -la .gnupg
test
test
test
test
test
test
test
test
4096
4096
9364
919
919
600
1057
1280
2010-05-24
2010-05-24
2010-05-24
2010-05-24
2010-05-24
2010-05-24
2010-05-24
2010-05-24
15:52
16:15
15:50
15:52
15:52
15:52
15:52
15:52
.
..
gpg.conf
pubring.gpg
pubring.gpg~
random_seed
secring.gpg
trustdb.gpg
TCP/IP by SV2DOF, . 47 / 48
(ascii25, --armor)
my_public_key.txt (--output my_public_key.txt) e-mail:
a.peleides@iliad.net (--export a.peleides@iliad.net) :
george@perseus:~$ gpg --armor --output my_public_key.txt --export
a.peleides@iliad.net
george@perseus:~$
.. --armor --output -a
-o (
) ..
george@perseus:~$ gpg -a -o my_public_key.txt --export \
george@perseus:~$
(1024 bit)
(standard output) :
george@perseus:/home/george$ gpg -a --export
-----BEGIN PGP PUBLIC KEY BLOCK----Version: GnuPG v1.4.9 (GNU/Linux)
mQGiBEv6dg0RBAC+wO1mDX0j3taqWtZm4JAHJ3C/jL0XiGok/ayBAV2NPjgkDZ/O
jzndviGobHympGolMHqc5cU/QenusEcOmvaTeFKMnRxWMeF+pJdfHB5utWvXgoum
KNt84bmulu+PpLSOLAgaeXJLkJdSxV8/HwxU9eeiAQVBD4yJ85pdNli1FwCg3LZM
pQhbASrEwEKuqxkSvgFk4+MD/2+WFTzuJhHRaCiBaw9csnNchppwEGBt1QTUzf2D
4QjQYls25l8fYHlYATsWu6ucNxTYLzDV4Cy2RSqVEJJayqBTyveVnrhIQ7HhrO0v
PcAKkxfh0zTp/Dy6/NuXstgAgvlmaUIPCh04xBYa/m7KyWv0nmRNmLGD9W6iJ7I0
oMPDA/wK+8hsLh1EnJErQsYd8FFdDcNhKJ/c3/2o0bts1j72vvloil1ghYjg84DU
pZ40fIIiQU2PDxrdjFIgfqEvfqliNof1Yw+wuBrFgdjP5nIXHUJhm1WnEklP1fCf
UoogBBVy/ba+FVPsBp5Lqdlqjh7z9s7mQg/ssRH4/Xaxs0ciuLQram9obiBzbWl0
aCAoZGVtbyBrZXkgcGFpcikgPHNtaXRoQHRlc3QubmV0PohgBBMRAgAgBQJL+nYN
AhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQutu1El5TtcnAYgCggSStiFb9
tb1cO1hIfY0lRk/zrnEAoIx/neIVp6VLPiZpb1TgLqU7ub2BuQENBEv6dg0QBACQ
K20SyJuZPfvMIsfCtTVqK5EQ+kfxSldRz5aydZDOZBRVXS5GuAuFpKZZxNb/kSh2
wKt8oJ/2exc11vBB4pph2Imy0x5vG0/fgMWvv7pP8BPXiO7g/ZuqAP4a1wylhgVw
4CblYsiLT/LPzRlcCsW3aa9hDAl2Oc7ST3dSLg6liwADBQP/cWU1C9GGXcm5bydX
n6eY7SLs3/3LyvTL3O/Kcev38+TbeGbmjL5opkTbGnPZvIxM9dcWeIZG3WRmmigm
zKln+4njKXFCK6hJGFEGdd3Eikeuv4QytL7wLbbgh91besbXealSTJFt1aIt5g7y
JPOCjI+0NRw1n4dZVyA696+4Gl2ISQQYEQIACQUCS/p2DQIbDAAKCRC627USXlO1
ycMAAKDWTSQMW29B+OYyo6gyDrSnfn3wFQCbBbv9R6aPG4I9P5+zlMvr+YXi1lE=
=RoNZ
-----END PGP PUBLIC KEY BLOCK----george@perseus:/home/george$
gpg.
http://users.pie.sch.gr/gxry/pages/gpg_intro-gr.utf8.html
() GNU Privacy Guard (GnuPG-1) Windows (
Achilleus).
http://www.glump.net/howto/gpg_intro
25 , (bin).
, e-mail , internet,
ASCII, base64
TCP/IP by SV2DOF, . 48 / 48