交换机配置命令

  • 格式:docx
  • 大小:73.02 KB
  • 文档页数:8

交换机配置命令文稿归稿存档编号:[KKUY-KKIO69-OTM243-OLUI129-G00I-FDQS58-配置命令交换机之间用交叉线1进入特权模式:Switch>enable2配置模式 Switch#config3配置主机名:Switch(config)#hostname S1 4.设置访问口令S1#configure terminalS1(config)#line console 0S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#exit5.将使能加密口令设置为 class。

S1(config)#enable secret classS1(config)#配置默认网关6.在虚拟接口vlan99设置交换机ip地址S1(config)#interface vlan99S1(config-if)#S1(config-if)#no shutdownS1(config-if)#exit7.交换机 VLAN 分配端口S1(config)#interface fa0/1S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 99S1(config-if)#exit8.给vlan命名S1(config)#vlan 10S1(config-vlan)#name Faculty/StaffS2.S3.本征vlan即分配端口 s2.s3连接s1 使用中继vlan S1中继vlanS1(config)#interface FastEthernet 0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 999..设置交换机默认网关S1(config)#S1(config)#exit10..配置快速以太网接口的端口速率和双工设置。

S1#configure terminalS1(config)#interface fastethernet 0/18S1(config-if)#speed 100S1(config-if)#duplex fullS1(config-if)#end11.清除mac地址表S1#clear mac-address-table dynamic12.设置静态 MAC 地址。

S1(config)#13.在接入端口上配置端口安全性。

配置交换机端口 FastEthernet 0/18 仅接受两台设备,动态学习这些设备的 MAC 地址,并在发生安全违规事件时关闭端口。

S1(config-if)#switchport mode accessS1(config-if)#switchport port-securityS1(config-if)#switchport port-security maximum 2S1(config-if)#switchport port-security mac-address stickyS1(config-if)#switchport port-security violation shutdownS1(config-if)#exit14.配置并测试 MOTD 标语。

配置当天消息 (MOTD),文本使用?Authorized Access Only(仅限授权访问)。

标语文本区分大小写。

请勿在标语文本前后添加空格。

在标语文本前后使用定界符指示文本从何处开始,到何处结束。

下例中使用的定界符为?&,但是您可以使用标语文本中未使用的任何字符。

配置完MOTD 后,从交换机注销,然后再次登录,检查是否显示了上述标语。

S1(config)#banner motd &Authorized Access Only&S1(config)#end [or exit]S1#exit15. 首先必须启用端口安全性,方能在接口上使用其它端口安全性命令。

启用18号端口安全性S1(config-if)#interface fa0/18S1(config-if)#switchport port-securityShow1.Show vlan 看默认vlan 配置2.发出?show running-config?命令,检查当前的运行配置3.发出?show startup-config?命令,检查当前 NVRAM 的内容4.发出?show interface vlan1?命令,检查虚拟接口 VLAN1 的特征5.现在使用?show ip interface vlan1?命令查看该接口的 IP 属性6.使用?show version?命令显示 Cisco IOS 信息7.使用?show interface fastethernet 0/18?命令检查 PC1 所用快速以太网接口的默认属性。

8. 在特权执行模式下使用?show mac-address-table?命令显示 MAC 地址9. 创建 VLAN 后,返回特权执行模式并发出?show vlan brief?命令,检查新 VLAN 是否创建成功。

其他命令删除vlan数据库信息 Switch#delete flash:vlan.dat从NVRAM中删除交换机启动配置文件Switch#erase startup-config在特权执行模式提示符下,输入?reload?命令开始这一过程。

Switch#reload要把运行配置文件的内容保存到非易失性 RAM (NVRAM),请发出命令?copy running-config startup-config。

Switch#copy running-config startup-config第四章1.vtp默认配置: show vtp status2.S1 将成为 VTP 服务器。

将 S1 设置为服务器模式。

S1(config)#vtp mode serverDevice mode already VTP SERVER.3. 将 S1 的 VTP 域名配置为 CCNA。

请记住,VTP 域名区分大小写。

S1(config)#vtp domain CCNAChanging VTP domain name from NULL to CCNA4. 将 S1 的 VTP 域口令配置为 cisco。

请记住,VTP 域口令区分大小写。

S1(config)#vtp password ciscoSetting device VLAN database password to ciscoS1(config)#5.配置主辅银桥S1 (config): spanning-tree vlan 1 root primaryS1(config): spanning-tree vlan 1 root secondary6.配置桥的优先级S1 (config):spanning-tree vlan 1 priority 40967.检验网桥优先级Show spanning-tree8.使用 802.1Q 封装配置子接口。

在 R1 上创建两个子接口:Fa0/1.10 和 Fa0/1.30。

将这两个子接口分配到不同的 VLAN。

要创建第一个子接口,请发出 interface fa0/1.10 命令进入 Fa0/1.10 的子接口配置模式。

请留意,路由器的命令提示符会更改。

在子接口配置模式下发出 encapsulation dot1Q 10 命令,将封装类型设置为 802.1Q 并将 VLAN 10 分配给该虚拟接口。

为端口分配正确的 IP 地址。

Fa0/1.10 的 IP 地址应为,子网掩码为。

使用正确的 IP 地址和 VLAN ID 对 Fa0/1.30 接口重复上述步骤。

R1(config)#interface fa0/1.10R1(config-subif)#encapsulation dot1Q 10R1(config-subif)#interface fa0/1.30R1(config-subif)#encapsulation dot1Q 30任务 2:将 PPP 配置为封装方法。

步骤 1. 将 R1 配置为与 R2 之间使用 PPP 封装。

R1(config)#interface serial0/0/0R1(config-if)#encapsulation ppp步骤 1. 将 ISP 配置为与 R2 之间使用 HDLC 封装。

ISP(config)#interface serial0/0/0ISP(config-if)#encapsulation hdlcISP(config-if)#no shutdown步骤 1. 将 ANSI 配置为 R1、R2 和 R3 上的 LMI 类型。

对每台路由器的串行接口输入下列命令。

R1(config-if)#interface s0/0/0R1(config-if)#frame-relay lmi-type ansi。