1.1组网需求
在企业内部网络中划分了vlan,当vlan之间有部分主机需要通信,但二层交换机不满足要求,为了节约成本,这时候可以采用一台支持802.1q的路由器实现vlan的互通,这时候就需要单臂路由的组网结构
1.2组网拓扑
1.3实验目标
a.熟悉层次化配制方法
b.掌握单臂路由的配置命令
c.实现全网连通性,包括交换机的网管vlan
d.分析pc1和pc2的通信过程
1.4实验步骤
1.4.1基本配置
Router>enable
Router#configure terminal
Router(config)#no ip domain-lookup
Router(config)#line console 0
Router(config-line)# logging synchronous
Router(config-line)# exec-timeout 0 0
Router(config-line)# no login
Router(config-line)#
Router(config-line)#line vty 0 4
Router(config-line)# no login
Router(config-line)#
Router(config-line)#exit
Router(config)#ho R1
R1(config)#
Router>enable
Router#configure terminal
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#line console 0
Router(config-line)# logging synchronous
Router(config-line)# exec-timeout 0 0
Router(config-line)# no login
Router(config-line)#
Router(config-line)#line vty 0 4
Router(config-line)# no login
Router(config-line)#
Router(config-line)#exit
Router(config)#ho SW2
SW2(config)#
1.4.2二层链路及vlan配置和测试
SW2#vlan data
SW2(vlan)#vlan 11
VLAN 11 added:
Name: VLAN0011
SW2(vlan)#vlan 21
VLAN 21 added:
Name: VLAN0021
SW2(vlan)#exit
APPLY completed.
Exiting....
SW2#show vlan-sw
VLAN Name Status Ports
---- ----------------------------------------- -------------------------------
1 default active Fa0/0, Fa0/1, Fa0/2,Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
11 VLAN0011 active
21 VLAN0021 active
SW2(config)#int f0/2
SW2(config-if)#swi acc vlan 11
SW2(config-if)#exit
SW2(config)#int f0/3
SW2(config-if)#swi m acc
SW2(config-if)#swi acc vlan 21
SW2(config-if)#exit
SW2(config)#int f0/1
SW2(config-if)#swi m tr
SW2(config-if)#swi trun allow vlan all
SW2(config-if)#exit
1.4.3三层接口配置及调试
R1(config-if)#int f0/0.11
R1(config-subif)#encapsulation dot1Q 11
R1(config-subif)#ip add 192.168.11.1255.255.255.0
R1(config-subif)#encapsulation dot1Q11
R1(config-subif)#int f0/0.21
R1(config-subif)#encapsulation dot1Q 21
R1(config-subif)#no shut
R1(config-subif)#ip add 192.168.21.1255.255.255.0
R1#show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/0.11 192.168.21.1 YES manual up up
FastEthernet0/0.21 192.168.11.1 YES manual up up
R1#show ip route
Codes: C - connected, S - static, R - RIP,M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.11.0/24 is directly connected,FastEthernet0/0.21 //ip地址配错了
C 192.168.21.0/24 is directly connected,FastEthernet0/0.11
更正后还是没通发现多开了一个虚拟PC机窗口
1.4.4全网连通性测试