单臂路由+VLAN+trunk

                单臂路由+VLAN+trunk

valn配置命令

Sw1(config)#valn 10      //创建vlan ID

Sw1(config-vlan)#name xiaohang    //命名vlan

Sw1(config)#no vlan 10   //删除vlan

Sw1(config)#interface fastEthernet1/1           //选择分配端口

Sw1(config)#interface range fastEthernet 1/1 -5     //同时还分配多个端口

Sw1(config-if)#switchport mode access         //定义二层端口模式(思科设备默认就是二层端口模式,可省略)

Sw1(config-if)#switchport access vlan 10       //把端口加入vlan

sw1(config)#default interface fastEthernet 1/1   //还原接口到默认配置状态

sw2#show vlan-switch brief                 //查看vlan信息

trunk配置命令

sw1(config)#interface fastEthernet 1/15       //进接口

sw1(config-if)#switchport mode trunk        //配置接口为trunk

sw1(config-if)#switchport trunk allowed vlan remove 10   //trunk中删除某个vlan

sw1(config-if)#switchport trunk allowed vlan add 10      //trunk中添加某个vlan

sw1#show interfaces fastEthernet 1/15 switchport     //查看接口类型

单臂路由配置命令

R1(config)#interface fastEthernet 0/0.10       //进子接口

R1(config-subif)#encapsulation dot1Q 10      //封装

R1(config-subif)#ip address 192.168.1.1 255.255.255.0  //IP掩码

例题

wKioL1L6GAPgaJDYAAELhkbH7y4878.jpg

sw1 配置

!

no ip routing

vlan 10

valn 20

!

interface FastEthernet1/1

switchport access vlan 10

!

interface FastEthernet1/2

switchport access vlan 20

!

interface FastEthernet1/15

switchport mode trunk

!

interface FastEthernet1/0

switchport mode trunk

Sw2 配置

!

no ip routing

!

valn 10

valn 20

!

interface FastEthernet1/3

switchport access vlan 10

!

interface FastEthernet1/4

switchport access vlan 20

!

interface FastEthernet1/15

switchport mode trunk

R1 配置

!

interface FastEthernet0/0.10

encapsulation dot1Q 10

ip address 192.168.1.1 255.255.255.0

!

interface FastEthernet0/0.20

encapsulation dot1Q 20

ip address 192.168.2.1 255.255.255.0

!


你可能感兴趣的:(接口,Access,interface,default,思科设备)