【实验】观察ARP和ICMP
【实验】观察ARP和ICMP
【要求】
1)PC1和R1(静态路由)通信
2)观察ICMP的类型和代码
3)观察ARP的广播和应答
【配置】
在SW1和SW3分部建立vlan10 20 30 把R1和PC1划入相应vlan10 交换机之间应用trunk PC1能ping通R1
【SW1】
[SW1]vlan batch 10 20 30
[SW1]int gi 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW1]int gi 0/0/12
[SW1-GigabitEthernet0/0/12]port link-type access
[SW1-GigabitEthernet0/0/12]port default vlan 20
[SW1]int Vlanif 10
[SW1-Vlanif10]ip add 10.1.10.254 24
[SW1-Vlanif10]int vlan 20
[SW1-Vlanif20]ip add 10.1.20.254 255.255.255.0
【验证】
[SW1]dis ip int bri
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned up down
Vlanif10 10.1.10.254/24 up up
Vlanif20 10.1.20.254/24 up up
【SW3】
[SW3]int gi 0/0/1
[SW3-GigabitEthernet0/0/1]port link-type trunk
[SW3-GigabitEthernet0/0/1]port trunk al vlan all
interface GigabitEthernet0/0/10
port link-type access
port default vlan 10
【验证】
[SW1]dis port vlan ac
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0/0/1 trunk 1 U: 1
T: 10 20 30
GE0/0/2 hybrid 1 U: 1
GE0/0/3 hybrid 1 U: 1
GE0/0/4 hybrid 1 U: 1
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 hybrid 1 U: 1
GE0/0/11 hybrid 1 U: 1
GE0/0/12 access 10 U: 10
GE0/0/13 hybrid 1 U: 1
GE0/0/14 hybrid 1 U: 1
GE0/0/15 hybrid 1 U: 1
GE0/0/16 hybrid 1 U: 1
GE0/0/17 hybrid 1 U: 1
[SW3]dis port vlan active
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0/0/1 trunk 1 U: 1
T: 10 20 30
GE0/0/2 hybrid 1 U: 1
GE0/0/3 hybrid 1 U: 1
GE0/0/4 hybrid 1 U: 1
GE0/0/5 hybrid 1 U: 1
GE0/0/6 hybrid 1 U: 1
GE0/0/7 hybrid 1 U: 1
GE0/0/8 hybrid 1 U: 1
GE0/0/9 hybrid 1 U: 1
GE0/0/10 access 10 U: 10
GE0/0/11 hybrid 1 U: 1
GE0/0/12 hybrid 1 U: 1
GE0/0/13 hybrid 1 U: 1
GE0/0/14 hybrid 1 U: 1
【AR1的配置】
[AR1]int gi 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 10.1.20.1 24 //配置接口IP地址
[AR1]ip route-static 10.1.10.0 255.255.255.0 GigabitEthernet 0/0/0 10.1.20.254 //配置静态路由
【验证】
[AR1]dis ip routing-table 10.1.10.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.10.0/24 Static 60 0 D 10.1.20.254 GigabitEthernet0/0/0
【PC配置】
验证:ping 测试成功
【观察】
ARP和ICMP
Ping echo request 报文 (type=8 code=0)
Ping echo reply报文 (type=0 code =0)
ARP 报文
ARP 广播请求
ARP单播回复