思科模拟器配置-VLAN间的路由

vlan间的路由:
二层隔离,三层互通

在这里插入图片描述
PC配置:

交换机配置:

Switch>enable 
Switch#configure terminal 
Switch(config)#vlan 10							
Switch(config-vlan)#vlan 20							//创建vlan10 20
Switch(config-vlan)#exit
Switch(config)#interface fastEthernet 0/1			
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 10			//配置f01接为access口并加入vlan10
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3			
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 10			//配置f03口为access口并加入vlan10
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/4
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 20			//配置f02口,f04口为access口并加入vlan20

路由器配置:

Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#no shu
Router(config-if)#no shutdown 
Router(config-if)#exit
Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.2.254 255.255.255.0
Router(config-if)#no shutdown 

在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,下面我来为您介绍一下cisco模拟器中交换机路由器vlan的综合实例。 首先,我们需要准备以下设备: 1. 两台交换机,分别为Switch1和Switch2; 2. 一台路由器,为Router1; 3. 两个主机,分别为Host1和Host2。 接下来,我们将Host1和Host2连接到Switch1上,Switch1和Switch2之连接,Switch2连接到Router1上。 为了实现VLAN的功能,我们将Host1和Host2分别划分到不同的VLAN中。 具体操作如下: 1. 配置Switch1和Switch2 首先,我们需要为Switch1和Switch2配置基本的交换机设置,包括主机名、管理IP地址、密码等。 例如,我们可以为Switch1配置以下设置: ``` Switch> enable Switch# configure terminal Switch(config)# hostname Switch1 Switch1(config)# interface vlan 1 Switch1(config-if)# ip address 192.168.1.1 255.255.255.0 Switch1(config-if)# no shutdown Switch1(config-if)# exit Switch1(config)# enable secret cisco Switch1(config)# line console 0 Switch1(config-line)# password cisco Switch1(config-line)# login Switch1(config-line)# exit Switch1(config)# line vty 0 4 Switch1(config-line)# password cisco Switch1(config-line)# login Switch1(config-line)# exit ``` 同样地,我们也要为Switch2配置类似的设置。 2. 配置VLAN 接下来,我们需要为VLAN配置ID和名称,并将端口与VLAN绑定。 例如,我们可以为Switch1配置以下设置: ``` Switch1(config)# vlan 10 Switch1(config-vlan)# name VLAN10 Switch1(config)# interface range fastEthernet 0/1 - 2 Switch1(config-if-range)# switchport mode access Switch1(config-if-range)# switchport access vlan 10 Switch1(config-if-range)# exit Switch1(config)# vlan 20 Switch1(config-vlan)# name VLAN20 Switch1(config)# interface range fastEthernet 0/3 - 4 Switch1(config-if-range)# switchport mode access Switch1(config-if-range)# switchport access vlan 20 Switch1(config-if-range)# exit ``` 同样地,我们也要为Switch2配置类似的设置。 3. 配置路由器 接下来,我们需要为路由器配置IP地址,并将路由器的端口与交换机的端口连接。 例如,我们可以为Router1配置以下设置: ``` Router> enable Router# configure terminal Router(config)# hostname Router1 Router1(config)# interface fastEthernet 0/0 Router1(config-if)# ip address 192.168.1.254 255.255.255.0 Router1(config-if)# no shutdown Router1(config-if)# exit Router1(config)# interface fastEthernet 0/1 Router1(config-if)# ip address 192.168.2.254 255.255.255.0 Router1(config-if)# no shutdown Router1(config-if)# exit ``` 接着,我们需要为路由器配置路由,以便Host1和Host2可以相互通信。 例如,我们可以为Router1配置以下设置: ``` Router1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.1 ``` 4. 配置主机 最后,我们需要为Host1和Host2配置IP地址,并将它们连接到交换机的端口上。 例如,我们可以为Host1配置以下设置: ``` C:\>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : Host1 IP Address. . . . . . . . . . . . : 192.168.1.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.254 ``` 同样地,我们也要为Host2配置类似的设置。 至此,我们就成功地配置交换机路由器VLAN,并使得Host1和Host2可以相互通信。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

_abcdef

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值