实验设备
1台H3C S2126交换机,1台H3C E328交换机;
4台计算机,Windiwos XP操作系统,安装超级终端程序; 1条Cosole电缆(RJ45-DB9型); 5条双绞线
实验拓扑图
VLAN2VLAN2VLAN3VLAN3
实验的主要命令
port link-type trunk port trunk permit vlan ID port trunk permit vlan ID 主要的步骤也是设置端口的连接类型,添加vlan的ID号。
实验总结
次试验和上一个试验有点相似。在同一VLAN里的计算机能跨交换机相互通信。在不同VLAN里的计算机也能实现通信(使用三层交换来实现)。位于不同VLAN 内的主机之间不能直接通信,需要通过路由器或三层交换机等网络层设备进行转发,E328 以太网交换机支持通过配置VLAN 接口实现对报文进行三层转发。VLAN 接口是一种三层模式下的虚拟接口,主要用于实现VLAN 间的三层互通,它不作为物理实体存在于交换机上。每个VLAN 对应一个VLAN 接口,该接口可以为本VLAN 内端口收到的报文根据其目的 IP 地址在网络层进行转发。通常情况下,由于 VLAN 能够隔离广播域,因此每个VLAN 也对应一个 IP 网段,VLAN 接口将作为该网段的网关对需要跨网段转发的报文进行基于 IP 地址的三层转发。
项目二 局域网间互联
实验2.1 静态路由配置
实验目的
掌握在H3C路由器上配置静态路由。
实验设备
- 5 -
1条Cosole电缆(RJ45-DB9型); 4条直通双绞线;
1台H3C AR28-11路由器,1台H3C AR28-12路由器; 1台H3C S2126交换机、1台H3C E328交换机;
2台计算机,Windiwos XP操作系统,安装超级终端程序;
1条路由器背靠背连接电缆(1条V35DCE,1条V35DTE)。
实验拓扑图
RARBpc1pc2
实验的主要命令
IP address ip ip route-static目标网络 子网掩码 下一跳
显示路由器相关信息
#路由器A 的路由表 [RouterA]disp ip routing-table Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface
10.10.1.0/24 DIRECT 0 0 10.10.1.1 Ethernet0/0 10.10.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 10.10.2.0/24 DIRECT 0 0 10.10.2.1 Serial0/0 10.10.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 10.10.3.0/24 STATIC 60 0 10.10.2.2 Serial0/0
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 #路由器A 的接口信息
[RouterA]display interface Ethernet 0/0 Ethernet0/0 current state :UP Line protocol current state :UP
Description : Ethernet0/0 Interface
The Maximum Transmit Unit is 1500, Hold timer is 10(sec) Internet Address is 10.10.1.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e258-8582
- 6 -
Media type is twisted pair, loopback not set, promiscuous mode not set 100Mb/s, Full-duplex, link type is autonegotiation
Output flow-control is disabled, input flow-control is disabled Output queue : (Urgent queuing : Size/Length/Discards) 0/50/0 Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0 Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0 Last clearing of counters: Never
Last 300 seconds input rate 2.28 bytes/sec, 18 bits/sec, 0.01 packets/sec Last 300 seconds output rate 0.00 bytes/sec, 0 bits/sec, 0.00 packets/sec Input: 16 packets, 2038 bytes, 16 buffers 2 broadcasts, 14 multicasts, 0 pauses 0 errors, 0 runts, 0 giants 0 crc, 0 align errors, 0 overruns 0 dribbles, 0 drops, 0 no buffers 0 frame errors
Output:1 packets, 84 bytes, 2 buffers 2 broadcasts, 0 multicasts, 0 pauses 0 errors, 0 underruns, 0 collisions
0 deferred, 0 lost carriers
[RouterA]display interface Serial 0/0 Serial0/0 current state :UP Line protocol current state :UP Line protocol current state :UP The Maximum Transmit Unit is 1500, Hold timer is 10(sec) Internet Address is 10.10.2.1/24 Link layer protocol is PPP
LCP opened, IPCP opened, OSICP opened
Output queue : (Urgent queuing : Size/Length/Discards) 0/50/0 Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0 Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0 Physical layer is synchronous,Baudrate is 64000 bps Interface is DCE, Cable type is V35
Last clearing of counters: Never
Last 300 seconds input rate 14.86 bytes/sec, 118 bits/sec, 0.23 packets/sec Last 300 seconds output rate 2.40 bytes/sec, 19 bits/sec, 0.20 packets/sec Input: 481 packets, 31362 bytes 78 broadcasts, 0 multicasts
0 errors, 0 runts, 0 giants
0 CRC, 0 align errors, 0 overruns 0 dribbles, 0 aborts, 0 no buffers 0 frame errors
Output:432 packets, 14380 bytes
0 errors, 0 underruns, 0 collisions 0 deferred
- 7 -
DCD=UP DTR=UP DSR=UP RTS=UP CTS=UP
实验总结
静态路由是一种特殊的路由,它由管理员手工配置而成。通过静态路由的配置可建立一个互通的网络,但这种配置缺点在于:当一个网络故障发生后,静态路由不会自动发生改变,必须有管理员的介入。在组网结构比较简单的网络中,只需配置静态路由就可以使路由器正常工作,适当设置和使用静态路由可以改进网络的性能,并可为重要的应用保证带宽。只要正确添加静态路由,那么就会实现不同的网络互通。
常见问题
常见故障:路由器没有配置动态路由协议,接口的物理状态和链路层协议状态均已处于 UP,但IP 报文不能正常转发。
故障排除:用 display ip routing-table protocol static 命令查看是否正确配置相应静态路由。用 display ip routing-table 命令查看该静态路由是否已经生效。
添加静态路由时容易把目标网络和下一跳搞错,以致网络不能互通
实验2.2 动态路由协议RIP配置
实验目的
掌握在H3C路由器上配置RIP协议。
实验设备
1台H3C AR28-11路由器,1台H3C AR28-12路由器; 1台H3C S2126交换机、1台H3C E328交换机;
2台计算机,Windiwos XP操作系统,安装超级终端程序; 1条Cosole电缆(RJ45-DB9型);
4条直通双绞线;
1条路由器背靠背连接电缆(1条V35DCE,1条V35DTE)。
实验拓扑图
RARBpc1pc2
实验的主要命令
Rip network 网络号
- 8 -
显示路由器相关信息
[R11]dis cur #
sysname R11 #
cpu-usage cycle 1min #
radius scheme system #
domain system #
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!! service-type telnet terminal level 3 service-type ftp #
interface Aux0 async mode flow #
interface Ethernet0/0 ip address dhcp-alloc #
interface Ethernet0/0.1
ip address 10.10.20.1 255.255.255.0 vlan-type dot1q vid 4 [R11]dis ip routing-table
Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface 10.10.18.0/24 RIP 100 1 10.10.21.1 Serial0/0 10.10.19.0/24 RIP 100 1 10.10.21.1 Serial0/0 10.10.20.0/24 DIRECT 0 0 10.10.20.1 Ethernet0/0.1 10.10.20.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 10.10.21.0/24 DIRECT 0 0 10.10.21.2 Serial0/0 10.10.21.1/32 DIRECT 0 0 10.10.21.1 Serial0/0 10.10.21.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
下面显示的信息是在rip协议的基础上添加静态路由
Destination/Mask Protocol Pre Cost Nexthop Interface
- 9 -