思科单臂路由配置

在这里插入图片描述
交换机配置如下:
Switch>en
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10 创建vlan 10
Switch(config-vlan)#vlan 20 创建vlan 20
Switch(config-vlan)#exit

Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode access 设置交换机1号端口为access
Switch(config-if)#switchport access vlan 10 把端口添加的vlan 10
Switch(config-if)#no shutdown 打开端口

Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport mode access 设置交换机2号端口为access
Switch(config-if)#switchport access vlan 20 把端口添加的vlan 10
Switch(config-if)#no shutdown 开启端口

Switch(config-if)#interface fastEthernet 0/3
Switch(config-if)#switchport mode trunk 设置3号端口为trunk
注:接入链路
交换机到用户设备的链路,即是接入到户,可以理解为由交换机向用户的链路。由于大多数电脑不能发送带vlan tag的帧,所以这段链路可以理解为不带vlan tag的链路。
干道链路
交换机到上层设备如交换机、路由器的链路,可以理解为向广域网走的链路。这段链路由于要靠vlan来区分用户或者服务,所以一般都带有vlan tag。
Switch(config-if)#no shutdown

路由器配置如下:

Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown 打开与交换机连接的端口

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit

Router(config)#interface fastEthernet 0/0.1 创建一个0/0.1的子接口

%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up
Router(config-subif)#encapsulation dot1Q 10 封装IEEE802协议到vlan10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0 添加vlan 10 的默认网关地址
Router(config-subif)#no shutdown
Router(config-subif)#ex

Router(config)#interface fastEthernet 0/0.2 创建一个0/0.2的子接口

%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
Router(config-subif)#encapsulation dot1Q 20 封装IEEE802协议到vlan20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0添加vlan 20 的默认网关地址
Router(config-subif)#no shutdown
Router(config-subif)#

  • 8
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值