2018-12-15 远程管理

本文档详细介绍了如何配置二层和三层交换机,包括创建VLAN、设置接口状态、分配IP地址以及启用路由和远程访问权限,以实现远程管理。通过示例配置,展示了从命令行界面进行操作的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述

二层交换机:

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#int vlan 10

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

no shut

Switch(config-if)#exit

Switch(config)#int vlan 20

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

Switch(config-if)#no shut

Switch(config-if)#exit

Switch(config)#int f 0/1

Switch(config-if)#sw m a

Switch(config-if)#sw a vlan 10

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#exit

Switch(config)#int f 0/2

Switch(config-if)#sw m a

Switch(config-if)#sw a vlan 20

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#exit

Switch(config)#int r f 0/23-24

Switch(config-if-range)#sw m t

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

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

Switch(config-if-range)#exit

Switch(config)#vlan 8

Switch(config-vlan)#name guanli

Switch(config-vlan)#exit

Switch(config)#int vlan 8

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan8, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan8, changed state to up

no shut

Switch(config-if)#ip add 192.168.8.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#

三层交换机:

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#int r f 0/1-2

Switch(config-if-range)#sw m a

Switch(config-if-range)#sw m t

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

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

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

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

Switch(config-if-range)#exit

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#int vlan 10

%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.1.1 255.255.255.0

Switch(config-if)#exit

Switch(config)#int vlan 20

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.2.1 255.255.255.0

Switch(config-if)#exit

Switch(config)#vlan 8

Switch(config-vlan)#name guanli

Switch(config-vlan)#exit

Switch(config)#int vlan 8

%LINK-5-CHANGED: Interface Vlan8, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan8, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.8.1 255.255.255.0

Switch(config-if)#exit

Switch(config)#ip routing

Switch(config)#enable password admin

Switch(config)#line vty 0

Switch(config-line)#password admin

Switch(config-line)#login

Switch(config-line)#exit

Switch(config)#

终端设备192.168.1.2:

PC>ping 192.168.8.1

Pinging 192.168.8.1 with 32 bytes of data:

Reply from 192.168.8.1: bytes=32 time=19ms TTL=255

Reply from 192.168.8.1: bytes=32 time=9ms TTL=255

Reply from 192.168.8.1: bytes=32 time=8ms TTL=255

Reply from 192.168.8.1: bytes=32 time=9ms TTL=255

Ping statistics for 192.168.8.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 8ms, Maximum = 19ms, Average = 11ms

PC>telnet 192.168.8.1

Trying 192.168.8.1 …Open

User Access Verification

Password:

Switch>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值