1、帮你解决一切难题包括企业和个人一切的一切 http:/ 现在=免费注册=( 用你的姓名抢注)享受会员功能极力推荐。补充一下信息实名认证要用到身份证相片用手机照下来然后上传上去就行了,实名认证是对用户资料的真实性进行验证审核。保障用户的合法权益。Cisco 交换机的部分命令解析一、交换机五种模式Swith (用户模式)Swith# (特权模式)Swith(config)# (全局配置模式)Swith(config-if)# (接口模式)Swith(config-line)# (线模式)二、交换机模式切换Swithenable /切换到特权Swith#config t /切换到全局配置模式Swit
2、h(config)# interface f0/1 /进入接口f0/0Swith(config)# interface vlan 1 /进入VLAN 1中Swith(config-if)#ip address 192.168.1.1 255.255.255.0 /对VLAN1设置IP地址和子网掩码Swith(config-if)#no shutdown /激活VLAN1三、设置交换机的密码1、用户到特权的密码Swith(config)#enable password 123 (优先级低)Swith(config)#enable secret 456 (优先级高) /如果两个都设置则 456生效
3、2、控制台console 密码设置Swith(config)# line con 0Swith(config-line)#loginSwith(config-line)#password console123 /设置console密码为telnet1233、启用telnet 密码Swith(config)#line vty 0 15 /最多有015 人可以telnet 访问swith ,合计16人Swith(config-line)#loginSwith(config-line)#password telnet123 /设置telnet密码为telnet123注:要想真正生效telnet还要设
4、置特权密码交换 机命名 hostname BENETSW01Swith(config)#hostname BENETSW01 /使用hostname命名交换机的名字四、show 命令集Swith#show version/显示IOS版本信息Swith#show int vlan 1 brief/简单的显示VLAN1 的信息Swith#show running-config/显示正在运行的配置文件Swith#show startup-config/显示己经保存的配置文件Swith#show mac-address-table/显示MAC地址表Swith#show mac-address-tabl
5、e/显示MAC地址表更新的间隔,默认为5分钟Swith#show neighbor detail/显示邻居详细信息Swith#show traffic/显示CDP流量Swith#show 五、设置交换机的网关和 DNS 名称服务器的 IP 地址帮你解决一切难题包括企业和个人一切的一切 http:/ 现在=免费注册=( 用你的姓名抢注)享受会员功能极力推荐。补充一下信息实名认证要用到身份证相片用手机照下来然后上传上去就行了,实名认证是对用户资料的真实性进行验证审核。保障用户的合法权益。Swith(config)# ip default-gateway 192.168.10.8/交换机的网关设置为
6、192.168.10.8Swith(config)#ip domain -name server 202.106.0.20 /设置DNS 名称服务器地址Swith(config)# no ip domain-lookup /交换机名称服务器的域名查询六、创建、删除、查看 VLANSwitch#vlan database /进入vlan数据库配置模式Switch(vlan)#vlan 2 /创 建VLAN2命名为vlan0002,也可以使用vlan2 name salesVLAN 2 added:Name: VLAN0002Switch(vlan)#exit /退出时应用生效Swith(vlan
7、)#no vlan 2 /删除vlan2Switch(config)# interface f0/1Switch(config-if)# switchport access vlan 2 /将端口加入vlan 2中Switch(config-if)# no switchport access vlan 2 /将端口从vlan2中删除Switch(config)# interface range f0/1 10 / 进行F0/1到10端口范围Switch(config-if-range)# switchport access vlan 2 /将f0/1到f0/10之间的所有端口加入vlan 2S
8、witch# show vlan brief /查看所有VLAN的摘要信息Switch# show vlan id vlan-id /查看指定VLAN的信息七、开启并查看 trunk 端Swith(config)#interface f0/24Swith(config-if)#swith mode trunk /将f0/24 端口设置为trunkSwitch#show interfacef0/24 switchport /查看f0/24的接口状态八、从 Trunk 中添加、删除 VlanSwitch (config-if )# switchport trunk allowed vlan rem
9、ove 3 /从trunk端口删除v lan3通过Switch (config-if)# switchport trunk allowed vlan add 3 /从trunk端口添加vlan3通过Switch # show interface interface-id switchport /检查中继端口允许VLAN的列表九、单臂路由配置Router(config)# interface f0/0.1Router(config-subif)# encapsolution dot1q 1 /子接口封装dot1q 针对的是VLAN1Router(config-subif)# ip address
10、 192.168.1.1 255.255.255.0 /设置VLAN的网关地址Router(config)# interface f0/0.2Router(config-subif)# encapsolution dot1q 2/子接口封装dot1q针对的是vlan2Router(config-subif)# ip address192.168.2.1 255.255.255.0/设置vlan2的网关的地址Cisco 路由器的部分命令解析一、路由器的模式 用户模式:Router /用户模式 特权模式:Router# /特权模式 全局配置模式:Router(config)# /配置模式帮你解决一
11、切难题包括企业和个人一切的一切 http:/ 现在=免费注册=( 用你的姓名抢注)享受会员功能极力推荐。补充一下信息实名认证要用到身份证相片用手机照下来然后上传上去就行了,实名认证是对用户资料的真实性进行验证审核。保障用户的合法权益。 接口配置模式:Router(config-if)# /接口模式 子接口配置模式:Router(config)#interface fa0/0.1 /进入子接口Router(config-subif)# /子接口状态 Line模式:Router(config-line)# /进行线模式 路由模式:Router(config-router)# /路由配置模式二、配置
12、静态路由条目Router(config)#ip route 192.168.10.0 255.255.255.0 192.168.9.2 /到达192.168.10.0网段及掩码需要经过相邻路由器的接口的IP地址三、配置默认路由Router B(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2 /所以外出的数据包如果找不到路由表目均找192.168.2.2接口四、密码配置配置控制台密码teacher(config)#line console 0teacher(config_line)#loginteacher(config_line)#password
13、ciscoteacher(config)#enable password cisco/配置特权模式密码teacher(config)#enable secret 1234/配置加密保存的密码teacher(config)#service password-encryption/对所有密码加密五、配置路由器的 banner 信息teacher(config)#banner motd $This is Aptech companys Router! Please dont change the configuration without permission! $六、配置路由器接口的描述信息tea
14、cher(config)#interface fastethernet 0/0teacher(config_if)#description connecting the companys intranet! 七、配置控制台配置控制台会话时间teacher(config)#line console 0teacher(config_line)#exec-timeout 0 0配置控制台输出日志同步teacher(config)#line console 0teacher(config_line)#logging synchronous八、动态路由相关命令Router(config)# router
15、 rip/启动RIP进程Router(config-router#version 2 /指定启动rip v2版本Router(config-router)# network network-number /宣告主 网络号Router# show ip route/查看路由表帮你解决一切难题包括企业和个人一切的一切 http:/ 现在=免费注册=( 用你的姓名抢注)享受会员功能极力推荐。补充一下信息实名认证要用到身份证相片用手机照下来然后上传上去就行了,实名认证是对用户资料的真实性进行验证审核。保障用户的合法权益。Router#show ip route static/仅显示静态路由信息 Rou
16、ter# show ip protocols /查看路由协议配置Rouetr# debug ip rip/打开RIP协议调试命令九、动态路由配置RouterA(config)#interface f0/0RouterA(config-if)#ip address 192.168.1.1 255.255.255.0RouterA(config-if)#no shutdownRouterA(config)#interface f0/1RouterA(config-if)#ip address 10.0.0.2 255.0.0.0RouterA(config-if)#no shutdownRoute
17、rA(config)#router ripRouterA(config-router)#network 10.0.0.0RouterA(config-router)#network 192.168.1.0十、路由器密码恢复进入ROM Monitor模式修改配置寄存器的值,启动时绕过startup-config文件:rommon1confreg 0x2142rommon2reset用startup-config覆盖running-config:Router#copy startup-config running-config修改密码:Router(config)#enable password cisco修改配置寄存器的值:Router(config)#config-register 0x2102