当前位置:千优问>常见问答>思科配置单臂路由 举个例子

思科配置单臂路由 举个例子

2022-12-03 00:34:47 编辑:join 浏览量:645

思科配置单臂路由 举个例子

思科配置单臂路由 举个例子

单臂路由路由器配置:1设置F0/0接口无IP,开启接口。interface FastEthernet0/0 no ip address2在FA0/0接口上设置两个子接口,分别更改封装为DOT1Q,并设置各自的IP地址。interface FastEthernet0/0.1 encapsulation dot1Q 2 ip address 1.1.1.1 255.255.255.0!interface FastEthernet0/0.2 encapsulation dot1Q 3 ip address 2.2.2.1 255.255.255.0要注意的是这里的VLAN号码要和交换机中的VLAN号对应起来。 交换机配置:首先在交换机上划分两个VLAN。Vlan 2 name pc1Vlan 3 name pc21 将交换机连接路由器的接口设置为TRUNK。 interface FastEthernet1/5 switchport mode trunk!2 将交换机连接两台PC的接口绑定到不同的VLAN中去。interface FastEthernet1/11 switchport access vlan 2!interface FastEthernet1/12 switchport access vlan 3PC配置:给PC的F0/0接口设置与路由器对应子接口同一网段的IP地址。PC1interface FastEthernet0/0 ip address 1.1.1.2 255.255.255.0!PC2interface FastEthernet0/0 ip address 2.2.2.2 255.255.255.0!给两个PC分别设置一条缺省路由,将出口指向F0/0,即划分入VLAN的接口。ip route 0.0.0.0 0.0.0.0 FastEthernet0/0至此,单臂路由的实验配置完成。测试的时候在PC1上PING一下PC2,应该可以看到结果。要点:1,注意子接口的IP要和PC的IP在同一网段。2,要确保所有接口的配置正确,并都打开了接口。3,作为PC使用的路由器上必须配置有正确的路由条目。例子:s2960一台,r2811一台,PC2台SW#vlan databaseSW(vlan)#vlan 2VLAN 2 added: Name: VLAN0002SW(vlan)#vlan 3VLAN 3 added: Name: VLAN0003SW(vlan)#exitSW(config)#int f0/2SW(config-if)#switchport mode accessSW(config-if)#switchport access vlan 2SW(config-if)#no shutdownSW(config-if)#int f0/3SW(config-if)#switchport mode accessSW(config-if)#switchport access vlan 3SW(config-if)#no shutdownSW(config-if)#int f0/1SW(config-if)#switchport mode trunkSW(config-if)#no shutdown路由器配置如下:R(config)#int f0/0R(config-if)#no shutdownR(config-if)#int f0/0.2R(config-subif)#encapsulation dot1q 2R(config-subif)#ip address 192.168.2.254 255.255.255.0R(config-subif)#no shutdownR(config-subif)#int f0/0.3R(config-subif)#encapsulation dot1q 3R(config-subif)#ip address 192.168.3.254 255.255.255.0R(config-subif)#no shutdownR(config-subif)#end客户机配置如下:HostA:ip:192.168.2.1/24ip default-gateway:192.168.2.254HostB:ip:192.168.3.1/24ip default-gateway:192.168.3.254

标签:单臂,路由,思科