思科模拟器配置-基本操作和vlan实训

根据下面的拓扑图进行配置,保证全网互通,VLAN间能互通

在这里插入图片描述

S1上配置VTY登录,限制3台主机,保存运行配置到启动配置文件。

S1(config)#line vty 0 2
S1(config-line)#exit
S1(config)#exit
S1#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]

S1使用本地数据库验证方式,添加用户a1:1234。配置特权加密口令为2345。

S1(config)#line vty 0 2
S1(config-line)#login local
S1(config-line)#exit
S1(config)#username a1 password 1234
S1(config)#enable password 2345

给各交换机配置VLAN,VLAN管理地址均为本网段最后一个地址。

S1:

S1(config)#vlan 50
S1(config-vlan)#vlan 60
S1(config-vlan)#exit
S1(config)#interface vlan 50
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan50, changed state to up
S1(config-if)#ip address 172.0.50.254 255.255.255.0
S1(config-if)#exit
S1(config)#interface vlan 60
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan60, changed state to up
S1(config-if)#ip address 172.0.60.254 255.255.255.0

S2:

S2(config)#vlan 10
S2(config-vlan)#vlan 20
S2(config-vlan)#exit
S2(config)#interface vlan 10
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
S2(config-if)#ip address 172.0.10.254 255.255.255.0
S2(config-if)#exit
S2(config)#interface vlan 20
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
S2(config-if)#ip address 172.0.20.254 255.255.255.0

S1上配单臂路由,S3上配三层交换路由。

配置各pc ip
在这里插入图片描述

S1:

S1(config)#interface fastEthernet 0/5
S1(config-if)#switchport mode access 
S1(config-if)#switchport access vlan 50
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan50, changed state to up
S1(config-if)#exit
S1(config)#interface fastEthernet 0/6
S1(config-if)#switchport mode access 
S1(config-if)#switchport access vlan 60
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan60, changed state to up
S1(config-if)#exit
S1(config)#interface fastEthernet 0/1
S1(config-if)#switchport mode trunk 
S1(config-if)#

R1:

R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fastEthernet 0/0
R1(config-if)#no shutdown 
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface fastEthernet 0/0.50
R1(config-subif)#
R1(config-subif)#ip add
R1(config-subif)#ip address 172.0.50.1 255.255.255.0
R1(config-subif)#encapsulation dot1Q 50
R1(config-subif)#ip address 172.0.50.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface fastEthernet 0/0.60
R1(config-subif)#
R1(config-subif)#encapsulation dot1Q 60
R1(config-subif)#ip address 172.0.60.1 255.255.255.0
R1(config-subif)#

验证可用性:
在这里插入图片描述

S2:
在这里插入图片描述

S2(config)#vlan 10
S2(config-vlan)#vlan 20
S2(config-vlan)#exit
S2(config)#interface fastEthernet 0/1
S2(config-if)#switchport mode access 
S2(config-if)#switchport access vlan 10
S2(config-if)#exit
S2(config)#interface fastEthernet 0/6
S2(config-if)#switchport mode access 
S2(config-if)#switchport access vlan 20
S2(config-if)#exit
S2(config)#interface fastEthernet 0/20
S2(config-if)#switchport mode trunk 

S3:

S3(config)#vlan 10
S3(config-vlan)#vlan 20
S3(config-vlan)#exit
S3(config)#interface fastEthernet 0/1
S3(config-if)#switchport mode access 
S3(config-if)#switchport access vlan 10
S3(config-if)#exit
S3(config)#interface fastEthernet 0/6
S3(config-if)#switchport mode access 
S3(config-if)#switchport access vlan 20
S3(config-if)#exit
S3(config)#ip routing

三层路由验证:

在这里插入图片描述

R0清除密码和所有配置,再配静态路由。

R0:

R0#erase startup-config
R0(config)#interface fastEthernet 0/1
R0(config-if)#no shutdown 
R0(config-if)#ip address 192.168.1.2 255.255.255.0
R0(config-if)#exit
R0(config)#interface fastEthernet 0/0
R0(config-if)#no shutdown 
R0(config-if)#ip address 192.168.0.1 255.255.255.0
R0(config-if)#exit
R0(config)#interface fastEthernet 1/0
R0(config-if)#no shutdown 
R0(config-if)#ip address 192.168.3.1 255.255.255.0
R0(config)#ip route 172.0.50.0 255.255.255.0 192.168.3.2
R0(config)#ip route 172.0.60.0 255.255.255.0 192.168.3.2
R0(config)#ip route 172.0.10.0 255.255.255.0 192.168.1.1
R0(config)#ip route 172.0.20.0 255.255.255.0 192.168.1.1

S3:

S3(config)#in fastEthernet 0/24
S3(config-if)#no switchport
S3(config-if)#ip address 192.168.1.1 255.255.255.0
S3(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2

在这里插入图片描述

R1配置默认路由,保存配置文件,并复制到server0的TFTP服务器。

R1(config)#interface fastEthernet 0/1
R1(config-if)#no shutdown 
R1(config-if)#ip address 192.168.3.2 255.255.255.0
R1(config-if)#exit
R1(config)#
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1

在这里插入图片描述

服务器:

在这里插入图片描述

R1#copy running-config tftp
Address or name of remote host []? 192.168.0.2
Destination filename [R1-confg]? y

Writing running-config...!!
[OK - 787 bytes]

787 bytes copied in 0 secs
R1#

在这里插入图片描述

END:

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

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
好的,下面我来为您介绍一下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可以相互通信。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

_abcdef

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

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

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

打赏作者

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

抵扣说明:

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

余额充值