[计算机网络]思科VLAN配置指令

①#改名字
Switch>enable                 \\进入特权执行模式
Switch #configure terminal    \\进入全局配置模式
Switch(config)#hostname MS1    \\修改主机名为MS1
MS1(config)#                     \\配置完注意观察命令提示符的变化


vlan database---进入vlan设置区---设置三个vlan:vlan 10,vlan 20,vlan 30
一个接口:
interface fa0/1
switchport  mode access
switchport access vlan 10
多个接口:
interface range fa0/4 - 5
switchport mode access
switchport access vlan 20


交换机与交换机之间配置Trunk:
接口的中继封装是“自动”不能被配置为“主干”的模式。
解决方法:
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk //先配置封装,再设置trunk
switchport trunk allowed vlan all
switchport trunk native vlan x(你想指定的VLAN ID)-----思科本征VLAN设置


Vlan接口配置:
interface vlan 10
ip address 192.168.1.4 255.255.255.0
no shutdown


开启路由:在全局模式下输入" ip routing ",就可以开启路由
也只有开启路由后才可以设置静态路由
ip route 0.0.0.0 0 xxx

猜你喜欢

转载自www.cnblogs.com/Skybiubiu/p/12624551.html