1、单臂路由配置的方法:
Switch>
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface f0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
Switch(config-if)#interface f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
Switch(config-if)#interface f0/3
Switch(config-if)#switchport trunk en?
% Unrecognized command
Switch(config-if)#switchport port
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk ?
allowed Set allowed VLAN characteristics when interface is in trunking mode
native Set trunking native characteristics when interface is in trunking
mode
Switch(config-if)#switch trunk allow vlan all
Router>enable
Router#config
Router(config)#interface f0/0
Router(config-if)#no shutdown
Router(config-if)#interface f0/0.10
Router(config-subif)#encapsulation dot1Q ?
<1-1005> IEEE 802.1Q VLAN ID
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 172.16.10.254 255.255.255.0
Router(config-subif)#interface f0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 172.168.20.254 255.255.255.0
Router(config-subif)#end
Router#copy runn start
会用到的一些命令:
show ip route
show running-config
ping ip
tracert ip
2、VLAN三层交换配置的方法:
PC1 PC2
Switch>enable
Switch#config terminal
Switch(config)#interface f0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
Switch(config-if)#interface f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
Switch(config-if)#interface vlan 10
Switch(config-if)#ip address 192.168.10.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#interface vlan 20
Switch(config-if)#ip address 192.168.20.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#ip routing
Switch(config)#exit
Switch#copy running start
在 pc2 ping测试
查看路由,命令show ip route
3 排查VLAN间路由故障的方法。
3.1 交换机配置问题
VLAN分配不正确及接入模式不正确
校验
S#show interfaces FastEthernet0/0switchport
S#show runn
3.2 路由器配置问题。
3.3 IP 编址问题。 |