文档详情

网络设备基本配置命令.doc

发布:2019-03-14约2.48万字共20页下载文档
文本预览下载声明
交换机部分命令 一、交换机模式切换 Swithenable //切换到特权 Swith#config t //切换到全局配置模式 Swith(config)# interface f0/1 //进入接口f0/0 Swith(config)# interface vlan 1 //进入VLAN 1中 Swith(config-if)#ip address //对VLAN1设置IP地址和子网掩码 Swith(config-if)#no shutdown //激活VLAN1 二、设置交换机的密码 1、用户到特权的密码 Swith(config)#enable password 123 (优先级低) Swith(config)#enable secret 456 (优先级高) //如果两个都设置则456生效 2、控制台console密码设置 Swith(config)# line con 0 Swith(config-line)#login Swith(config-line)#password console123 //设置console密码为telnet123 3、启用telnet密码 Swith(config)#line vty 0 15 //最多有0~15人可以telnet访问swith,合计16人 Swith(config-line)#login Swith(config-line)#password telnet123 //设置telnet密码为telnet123 注:要想真正生效telnet还要设置特权密码 三、交换机命名hostname BENETSW01 Swith(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-table //显示MAC地址表更新的间隔,默认为5分钟 Swith#show neighbor detail //显示邻居详细信息 Swith#show traffic //显示CDP流量 Swith#show 五、设置交换机的网关和DNS名称服务器的IP地址 Swith(config)# ip default-gateway //交换机的网关设置为 Swith(config)#ip domain -name server 0 //设置DNS名称服务器地址 Swith(config)# no ip domain-lookup //交换机名称服务器的域名查询 六、创建、删除、查看VLAN Switch#vlan database //进入vlan数据库配置模式 Switch(vlan)#vlan 2 //创建VLAN2自动命名为vlan0002,同vlan2 name sales VLAN 2 added: Name: VLAN0002 Switch(vlan)#exit //退出时应用生效 Swith(vlan)#no vlan 2 //删除vlan2 Switch(config)# interface f0/1 Switch(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 2 Switch# show vlan bri
显示全部
相似文档