网络设备模拟器:GNS3
抓包软件:Wireshark
一个普通ARP包(请求包的实际结构)
ARP包各字段具体含义(对比上面实际抓到的包)
字段 | 含义 |
硬件类型 | |
协议类型 | |
硬件地址长度 | |
协议地址长度 | |
操作字段 |
|
发送端以太网地址 | |
发送端IP地址 | |
目的以太网地址 | 占48位 |
目的IP地址 | 占32位 |
1
2
3
4
5
|
R1
#conf t
R1(config)
#int f0/0
R1(config-
if
)
#no shu
R1(config-
if
)
#ip add 192.168.1.1 255.255.255.0
R1(config-
if
)
#do wr
|
1
2
3
4
5
|
R2
#conf t
R2(config)
#int f0/0
R2(config-
if
)
#no shu
R2(config-
if
)
#ip add 192.168.1.2 255.255.255.0
R2(config-
if
)
#do wr
|
1
2
3
|
R1
#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 - cc01.127f.0000 ARPA FastEthernet0
/0
|
1
2
3
4
5
6
|
Router
#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4
/5
), round-trip min
/avg/max
= 44
/62/76
ms
|
ARP请求包
1
2
3
|
R1
#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 - cc01.127f.0000 ARPA FastEthernet0
/0
|
ARP响应包
有偿ARP
无偿ARP
1
2
3
4
|
R2>en
R2
#conf t
R2(config)
#int f0/0
R2(config-
if
)
#ip add 192.168.1.252 255.255.255.0
|
1
2
3
4
|
R2>en
R2
#conf t
R2(config)
#int f0/0
R2(config-
if
)
#ip add 192.168.1.1 255.255.255.0
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
R1>
*Mar 1 00:54:39.007: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
*Mar 1 00:55:09.043: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
*Mar 1 00:55:39.739: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
*Mar 1 00:56:10.011: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
*Mar 1 00:56:40.715: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
*Mar 1 00:57:10.947: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc02.1a18.0000
R2(config-
if
)
#
*Mar 1 00:45:48.135: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:46:18.623: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:46:48.927: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:47:19.651: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:47:49.959: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:48:21.623: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
*Mar 1 00:48:51.919: %IP-4-DUPADDR: Duplicate address 192.168.1.1 on FastEthernet0
/0
, sourced by cc01.127f.0000
|
1
2
3
|
R1>en
R1
#conf t
R1(config)
#ip route 0.0.0.0 0.0.0.0 f0/0
|
1
2
3
4
5
6
|
R2>en
R2
#conf t
R2(config)
#int f1/0
R2(config-
if
)
#no shu
R2(config-
if
)
#ip add 192.168.2.2 255.255.255.0
R2(config-
if
)
#do wr
|
1
2
3
4
5
6
7
|
R3>en
R3
#conf t
R3(config)
#int f0/0
R3(config-
if
)
#no shu
R3(config-
if
)
#ip add 192.168.2.3 255.255.255.0
R3(config-
if
)
#ip route 0.0.0.0 0.0.0.0 f0/0
R3(config-
if
)
#do wr
|
1
2
3
4
5
6
|
R1
#ping 192.168.2.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:
...!!
Success rate is 40 percent (2
/5
), round-trip min
/avg/max
= 36
/50/64
ms
|
ARP请求包
ARP响应包
1
2
3
4
5
6
|
R2
#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 3 cc01.127f.0000 ARPA FastEthernet0
/0
Internet 192.168.2.2 - cc02.1a18.0010 ARPA FastEthernet1
/0
Internet 192.168.2.3 3 cc03.2327.0000 ARPA FastEthernet1
/0
Internet 192.168.1.2 - cc02.1a18.0000 ARPA FastEthernet0
/0
|