交换机与路由器配置命令总结

合集下载

华为路由器交换机配置命令大全

华为路由器交换机配置命令大全

华为路由器交换机配置命令大全华为路由器交换机配置大全本文提供XXX路由器交换机的配置命令,包括计算机命令和交换机命令。

一、计算机命令以下是一些常用的计算机命令:shutdown-hnow;关机init 0;关机logout;用户注销login;用户登录ifconfig;显示IP地址ifconfig eth0 netmask;设置IP地址ifconfig eht0 netmask down;禁用IP地址route add 0.0.0.0 gw;设置网关route del 0.0.0.0 gw;删除网关route add default gw;设置网关route del default gw;删除网关route;显示网关ping;发ECHO包;远程登录二、XXX路由器交换机配置命令以下是一些常用的XXX路由器交换机配置命令:Quidway]dis cur;显示当前配置Quidway]display n;显示当前配置Quidway]display interfaces;显示接口信息Quidway]display vlan;显示vlan信息Quidway]display n;显示版本信息Quidway]super password;修改特权用户密码Quidway]sysname;交换机命名Quidway]XXX;进入接口视图Quidway]interface vlan x;进入接口视图Quidway-Vlan-interface x]ip address 10.65.1.1 255.255.0.0;配置VLAN的IP地址Quidway]Ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;静态路由=网关Quidway]rip;rip协议Quidway]local-user ftpQuidway]user-interface vty 0 4;进入虚拟终端S3026-ui-vty0-4]n-mode password;设置口令模式首先,这篇文章需要进行重新排版和编辑,以便更清晰地传达信息。

交换机和路由器常用命令大全

交换机和路由器常用命令大全

交换机和路由器配置命令Cisco 交换机的命令行模式:1、用户模式Switch>2、特权模式Switch>enableSwitch#3、全局配置模式Switch#config terminalSwitch(config)#4、接口模式Switch(config)#interface fastethernet 0/1Switch(config-if)#Fastethernet表示百兆位以太网接口。

Ethernet表示十兆位以太网接口。

Gigabitethernet表示千兆位以太网接口。

Tengigabitethernet表示万兆位以太网接口。

如果从特权模式回到用户模式,需要输入disable命令,其他无论在那个模式,只要输入命令exit就能回到前一个模式,在全局模式或是接口模式,只要输入命令end都能回到特权模式,或者按下ctrl+z组合键等效于命令end。

(命令行帮助机制:1、“?”。

2、Tab键。

)常用快捷组合键:Ctrl+A 光标移动到命令行的开始位置。

Ctrl+E 光标移动到命令行的结束位置。

一、常用命令介绍:1、hostname 用于配置主机名,可简写为host.Switch(config)#host sw1Sw1(config)#2、show version 显示系统IOS名称以及版本信息,可简写为sh ver.3、Show running-config 查看交换机当前配置信息,可简写为sh run.4、Show startup-config 显示已保存的配置信息,可简写为sh star.5、Copy running-config startup-config 保存当前配置信息,可简写为copy run star。

这个命令还等效于write(简写为wr)。

保存当前配置如下:Switch#wr 或者switch#copy run star6、erase nvram 删除已保存的配置信息,这命令等效于erase startup-config.(擦除)。

路由与交换的配置命令

路由与交换的配置命令

1、switch>:用户模式——能查看版本信息2、在用户模式下输入enable会进特权模式——它能保存、修改、删除这一系列的配置switch>enable→switch#:特权模式,下面有一些命令就在此命令下完成:①、删除vlan的文件配置:delete flash:vlan.dat②、删除vlan中的配置文件:erase startup-config③、查看vlan配置文件是否被删除及vlan的是否创建:show vlan④、重新启动交换机:reload⑤、查看当前交换机的配置:show running-config⑥、保存对交换机所配置的内容,即是保存在Nvram:copy running-configstartup-config⑦、检查Nvram的内容:show startup-config⑧、检查虚拟接口 vlan的特征:show interface vlan 1⑨、查看接口IP的属性:show ip interface vlan 1⑩、查看cisco的信息:show version⑪、查看交换机所用快速以太网接口的默认属性:show interface fastethernet 0/18⑫、查看闪存目录中的内容:show flash 或dir flash3、在特权模式下输入configure terninal后会进入全局模式,一切的配置必须在此模式中进行配置Switch#configure terninal→switchp(config)#:全局模式①、配置路由器设备的名字:switch(config)#hostname + 交换机的名字②、配置进入特权模式的密码,即使能密码:switch(config)#enable password +密码③、配置非明文密码:switch(config)#enable secret + 密码4、为交换机配置console口①、进入现成配置模式,即进入console口:switch(config)# line console 0②、设置密码(重新启动时需要此密码):switch(config-line)#password + 密码③、允许登录:switch(config-line)#login5、配置远程登录的密码:①、首先要配置使能密码②、允许让几个人登录:switch(config)#line vty 0 4(即允许五个登录)③、设置密码:switch(config-line)#password + 密码④、允许远程登录:switchp(config-line)#login6、在全局模式下的有关命令①对所有密码进行加密:switch(config)#service password-encryption②、不解析错误的命令:switch(config)#no ip domain-lookup7、创建vlan(2—1001,注vlan 1既不可以创建,也不可以删除)①、创建vlan :vlan + 要创建vlan的值②、给vlan取名:switch(config-vlan)#name + 名字(此步可以不要)③、把PC与交换机相连的端口添加到相应的vlan中:a、Switch(config)#interface + 端口b、Switch(config-if)#switchport access vlan + 相应vlan的值④、需要传递多个vlan信息就要打中继口,即trunka、switch(config)#interface + 交换机另一端口b、switch(config-if)#switchport mode trunk8、传统vlan 的通信(1)、router的配置①、为接口配置IP地址(该IP是相应vlan的PC网关)②、激活端口:no shutdown(2)、switch的配置①、创建vlan,将PC端口划入相应vlan②、将switch与router相连的端口划入相应的vlan(3) 、PC的配置:就是给PC配置IP,注PC的默认网关与router的IP相同,网关相同9、单臂路由实现vlan的通信(1)router配置①、添加子接口:interface f0/0.1(此处有多少个vlan就添加多少个子接口)②、将子接口封装到相应的vlan:encapsulation dot + 相应vlan的值③、将子接口配置IP:ip add +ip地址 + 子网掩码④、激活物理接口:no shutdown(2)、switch的配置①、创建 vlan,交PC的端口划入到相应vlan②、与router相连的端口打trunk(3)、配置PC的IP9、三层交换(1)、配置三层交换①、启用三层交换:(config)#ip routing②、创建vlan:(config)# vlan + 要创建vlan的值③、把相应的vlan配置IPa、指定一个vlan:(config)#interface vlan + vlan相应的值c、配置IP:(config-if)#ip add + ip + 子网掩码(2)、配置switch①、每个交换机创建vlan②、把端口划分到相应的vlan中③、打中继口(trunk)Show命令1、show version 这个命令可以查看IOS版本号,已启动时间,Flash中的IOS 的文件名,router里面共有什么端口,寄存器的值等等。

交换机与路由器基本命令

交换机与路由器基本命令

交换机与路由器基本命令交换机部分命令一、交换机五种模式Swith> (用户模式)Swith# (特权模式)Swith(config)# (全局配置模式)Swith(config-if)# (接口模式)Swith(config-line)# (线模式)二、交换机模式切换Swith>enable //切换到特权Swith#config t //切换到全局配置模式Swith(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生效2、控制台console密码设置Swith(config)# line con 0Swith(config-line)#loginSwith(config-line)#password console123 //设置console密码为telnet1233、启用telnet密码Swith(config)#line vty 0 15 //最多有0~15人可以telnet访问swith,合计16人Swith(config-line)#loginSwith(config-line)#password telnet123 //设置telnet密码为telnet123注:要想真正生效telnet还要设置特权密码三、交换机命名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-table //显示MAC地址表更新的间隔,默认为5分钟Swith#show neighbor detail //显示邻居详细信息Swith#show traffic //显示CDP流量Swith#show五、设置交换机的网关和DNS名称服务器的IP地址Swith(config)# ip default-gateway 192.168.10.8 //交换机的网关设置为192.168.10.8 Swith(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 sales VLAN 2 added:Name: VLAN0002Switch(vlan)#exit //退出时应用生效Swith(vlan)#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 2Switch# 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 interface f0/24 switchport //查看f0/24的接口状态八、从Trunk中添加、删除VlanSwitch (config-if )# switchport trunk allowed vlan remove 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 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 address 192.168.2.1 255.255.255.0 //设置vlan2的网关的地址路由命令部分一、路由器的模式v 用户模式:Router> //用户模式v 特权模式:Router# //特权模式v 全局配置模式:Router(config)# //配置模式v 接口配置模式:Router(config-if)# //接口模式v 子接口配置模式:Router(config)#interface fa0/0.1 //进入子接口Router(config-subif)# //子接口状态v Line模式:Router(config-line)# //进行线模式v 路由模式:Router(config-router)# //路由配置模式二、配置静态路由条目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接口四、密码配置v 配置控制台密码teacher(config)#line console 0teacher((config_line)#loginteacher((config_line)#password ciscoteacher(config)#enable password cisco //配置特权模式密码teacher(config)#enable secret 1234 //配置加密保存的密码teacher(config)#service password-encryption //对所有密码加密五、配置路由器的banner信息teacher(config)#banner motd $This is Aptech company’s Router! Please don’t change the configuration without permission! $六、配置路由器接口的描述信息teacher(config)#interface fastethernet 0/0teacher(config_if)#description connectin g the company’s intranet!七、配置控制台配置控制台会话时间teacher(config)#line console 0teacher(config_line)#exec-timeout 0 0配置控制台输出日志同步teacher(config)#line console 0teacher(config_line)#logging synchronous八、动态路由相关命令Router(config)# router rip //启动RIP进程Router(config-router#version 2 //指定启动rip v2版本Router(config-router)# network network-number //宣告主网络号Router# show ip route //查看路由表Router#show ip route static //仅显示静态路由信息Router# 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 shutdownRouterA(config)#router ripRouterA(config-router)#network 10.0.0.0RouterA(config-router)#network 192.168.1.0十、路由器密码恢复进入ROM Monitor模式修改配置寄存器的值,启动时绕过startup-config文件:rommon1>confreg 0×2142rommon2>reset用startup-config覆盖running-config:Router#copy startup-config running-config修改密码:Router(config)#enable password cisco修改配置寄存器的值:Router(config)#config-register 0×2102。

锐捷交换机、路由器设备配置指令

锐捷交换机、路由器设备配置指令

锐捷交换机、路由器设备配置指令一、交换机RG-S3760-B配置指令RG-S3760-2#conf t设置链路聚合RG-S3760-2(config)#int range fa0/23-24RG-S3760-2(config-if-range)#port-group 1RG-S3760-2(config-if-range)#exitRG-S3760-2(config)#int aggregateport 1RG-S3760-2(config-if-AggregatePort 1)#sw mo trRG-S3760-2(config-if-AggregatePort 1)#exit创建Vlan10-40RG-S3760-2(config)#vlan 10RG-S3760-2(config-vlan)#vlan 20RG-S3760-2(config-vlan)#vlan 30RG-S3760-2(config-vlan)#vlan 40RG-S3760-2(config-vlan)#exit给Vlan30、40分配端口RG-S3760-2(config)#int range fa0/4-10RG-S3760-2(config-if-range)#sw mo acRG-S3760-2(config-if-range)#sw ac vlan 30RG-S3760-2(config-if-range)#no shutdownRG-S3760-2(config-if-range)#exitRG-S3760-2(config)#int range fa0/11-16RG-S3760-2(config-if-range)#sw mo acRG-S3760-2(config-if-range)#sw ac vlan 40RG-S3760-2(config-if-range)#exit二、交换机RG-S3760-A配置指令RG-S3760-1#conf tRG-S3760-1#ip routing设置链路聚合RG-S3760-1(config)#int range fa0/23-24RG-S3760-1(config-if-range)#port-group 1RG-S3760-1(config-if-range)#no shutdownRG-S3760-1(config-if-range)#exitRG-S3760-1(config)#int aggregateport 1RG-S3760-1(config-if-AggregatePort 1)#sw mo trRG-S3760-1(config-if-AggregatePort 1)#exit创建Vlan10-40RG-S3760-1(config)#vlan 10RG-S3760-1(config-vlan)#vlan 20RG-S3760-1(config-vlan)#vlan 30RG-S3760-1(config-vlan)#vlan 40给Vlan10、20分配端口RG-S3760-1(config)#int range fa0/4-10RG-S3760-1(config-if-range)#sw mo acRG-S3760-1(config-if-range)#sw ac vlan 10RG-S3760-1(config-if-range)#exitRG-S3760-1(config)#int range fa0/11-16RG-S3760-1(config-if-range)#sw mo acRG-S3760-1(config-if-range)#sw ac vlan 20RG-S3760-1(config-if-range)#exit给Vlan10-40配置管理 IPRG-S3760-1(config)#int vlan 10RG-S3760-1(config-if-VLAN 10)#ip address 172.16.10.254 255.255.255.0RG-S3760-1(config-if-VLAN 10)#no shutdownRG-S3760-1(config-if-VLAN 10)#exitRG-S3760-1(config)#int vlan 20RG-S3760-1(config-if-VLAN 20)#ip address 172.16.20.254 255.255.255.0RG-S3760-1(config-if-VLAN 20)#no shutdownRG-S3760-1(config-if-VLAN 20)#exitRG-S3760-1(config)#int vlan 30RG-S3760-1(config-if-VLAN 30)#ip address 172.16.30.253 255.255.255.0RG-S3760-1(config-if-VLAN 30)#no shutdownRG-S3760-1(config-if-VLAN 30)#exitRG-S3760-1(config)#int vlan 40RG-S3760-1(config-if-VLAN 40)#ip address 172.16.40.253 255.255.255.0RG-S3760-1(config-if-VLAN 40)#no shutdownRG-S3760-1(config-if-VLAN 40)#exit设置三层路由接口IPRG-S3760-1(config)#int fa0/1RG-S3760-1(config-if-FastEthernet 0/1)#no switchportRG-S3760-1(config-if-FastEthernet 0/1)#ip address 192.168.1.2 255.255.255.252 RG-S3760-1(config-if-FastEthernet 0/1)#no shutdownRG-S3760-1(config-if-FastEthernet 0/1)#exit设置动态路由、默认路由RG-S3760-1(config)#router ripRG-S3760-1(config-router)#version 2RG-S3760-1(config-router)#no auto-summaryRG-S3760-1(config-router)#network 192.168.1.0RG-S3760-1(config-router)#network 172.16.10.0RG-S3760-1(config-router)#network 172.16.20.0RG-S3760-1(config-router)#network 172.16.30.0RG-S3760-1(config-router)#network 172.16.40.0RG-S3760-1(config-router)#exitRG-S3760-1(config)#ip route 0.0.0.0 0.0.0.0 fa0/1RG-S3760-1(config)#end三、路由器RSR20-A配置指令Red-Giant#conf tRed-Giant(config)#hostname RSR20-ARSR20-A(config)#int fa1/0RSR20-A(config-if)#ip address 192.168.1.1 255.255.255.252 RSR20-A(config-if)#no shutdownRSR20-A(config-if)#exit设置电信IPRSR20-A(config)#int s1/2RSR20-A(config-if)#ip address 119.1.1.1 255.255.255.252 RSR20-A(config-if)#no shutdownRSR20-A(config-if)#exit设置动态路由、默认路由RSR20-A(config)#router ripRSR20-A(config-router)#version 2RSR20-A(config-router)#no auto-summaryRSR20-A(config-router)#network 192.168.1.0RSR20-A(config)#ip route 0.0.0.0 0.0.0.0 s1/2配置NATRSR20-A(config)#int fa1/0RSR20-A(config-if)#ip nat insideRSR20-A(config-if)#exitRSR20-A(config)#int s1RSR20-A(config-if)#ip nat outsideRSR20-A(config-if)#exitRSR20-A(config)#access-list 10 permit 172.16.10.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.20.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.30.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.40.0 0.0.0.255RSR20-A(config)#ip nat pool net10 119.1.1.1 119.1.1.1 netmask 255.255.255.252 RSR20-A(config)#ip nat inside source list 10 pool net10 overload创建ACL,禁止172.16.20.0网去访问外网RSR20-A(config)#access-list 20 deny 172.16.20.0 0.0.0.255RSR20-A(config)#access-list 20 permit anyRSR20-A(config)#int fa1/0RSR20-A(config-if)#ip access-group 20 inRSR20-A(config-if)#exit四、路由器Internet配置指令R2600_2#conf tR2600_2 (config)#hostname Internet设置Internet路由器IPInternet (config)#int s1/2Internet (config-if)#ip address 119.1.1.2 255.255.255.252Internet (config-if)#clock rate 9600Internet (config-if)#no shutdownInternet (config-if)#exit设置Web服务器网关地址Internet 2(config)#int fa1/0Internet (config-if)#ip address 192.168.6.254 255.255.255.0Internet (config-if)#no shutdownInternet (config-if)#exit。

计算机四级考试_交换机_路由器命令总结

计算机四级考试_交换机_路由器命令总结

备注:黑体为需要输入的命令,/表示多项选一。

本总结只是命令的简答总结,不包括命令的使用环境等。

在机器型号方面3548和3500属于同一操作系统。

一般来讲3500系列的配置要先进入各个视图然后在各个视图下配置,而6500需要在全局模式下配置。

注意各种命令的选项和内容组成。

交换机命令:3548命令总结:基础命令:1.进入全局配置模式:config t2.设置主机名:hostname (添加主机名字)3.配置超级用户命令:enbale secret 5 (加密口令)4.配置远程登录口令:line vty 0 4Password 7(加密口令)Password 0 (明码口令)5.配置管理地址:interface VLAN1Ip address (ip 地址)(子网掩码)端口配置命令:1、进入端口配置模式:interface (端口号)2、配置端口配置信息:discription (对端口的描述)3、端口的开启和关闭:shutdown no shutdown4、配置端口的通信方式:duplex (auto /full/half)----(自动全双工半双工)5、配置端口的传输速率:speed (以Kbps为单位注意换算!)若为自动则使用命令speed autoVLAN配置模式命令:1、配置vtp 域名:vtp domain (域名)2、配置vtp 模式:vtp mode (sever/client/transparent)3、进入VLAN 模式:vlan data4、建立VLAN :vlan (vlan ID)name (vlan name)5、删除VLAN :no vlan (vlan ID)6、为端口分配VLAN :先进入端口模式然后输入:switchport access vlan (vlan ID)7、VLAN trunk 配置:先进入端口模式然后输入switchport mode trunk8、封装vlan 协议:switchport trunk encapsulation(dot1q/isl/negotiate)9、设置允许中继的VLAN:switchport trunk allowed valn (vlan ID)STP配置命令:1、打开或者关闭STP:spanning-tree vlan (vlan ID)no spanning-tree vlan (vlan ID)2、配置根网桥:spanning-tree vlan (vlan ID)root primary设置备份root :spanning-tree vlan (vlan ID)root secondary3、配置生成树的优先级:spanning-tree vlan (vlan ID)priority(0-61440)4、配置BackboneFast生成树可选功能:spanning-tree backbonefast5、配置UplinkFast生成树可选功能:spanning-tree uplinkfastspanning-tree uplinkfast max-update-rate (0-32000)6、配置portfast 功能:spanning-tree portfast default7、配置BPDU Filter可选功能:spanning-tree portfast bpdufilterdefault6500命令总结:基础命令:1、进入超级用户配置模式:enable2、设置主机名:s et system name (添加主机名字)3、配置超级用户命令:set enablepass(旧密码)(新密码)(新密码)4、配置远程登录口令:set password(旧密码)(新密码)(新密码)5、配置管理地址:set interface sc0 (ip 地址)(子网掩码)(广播地址)端口配置命令:6、配置端口配置信息:set port name’(mod/port)(name)7、端口的开启和关闭:set port enable(mod/port)set port disable(mod/port)8、配置端口的通信方式:set port duplex (mod/port)(auto/full/half)----(自动全双工半双工)9、配置端口的传输速率:set port speed (mod/port)(port-speed )---以Kbps为单位若为自动则使用命令set port speed(mod/port)auto set speed to dutoVLAN配置模式命令:10、配置vtp 域名:set vtp domain (域名)11、配置vtp 模式:set vtp mode (sever/client/transparent)12、建立VLAN :set vlan (vlan ID)name (vlan name)13、删除VLAN :clear vlan (vlan ID)14、为端口分配VLAN :set vlan(vlan ID)(mod/port)VLAN trunk 配置:set trunk (mod/port)(mode)(type)15、设置允许中继的VLAN:set trunk (mod/port)vlan (vlanID)STP配置命令:5、打开或者关闭STP:set spantree enable (vlan ID)6、配置根网桥:set spantree root (vlan ID)设置备份root :set spantree root secondary (vlan ID)7、配置生成树的优先级:set spantree priority (0-61440)8、配置BackboneFast生成树可选功能:set spantree backbonefast enable9、配置UplinkFast生成树可选功能:set spantree uplinkfast enableset spantree uplinkfast enable (单位是packet/ms)10、配置portfast 功能:set spantree portfast (mod/port)(enable/default/disable)11、配置BPDU Filter可选功能:set spantree portfast bpdu-filter(enable/disable)set spantree portfast bpdu-filter (mod/port)(enbale/disable/default)路由器命令1、进入全局模式:configure terminal2、几个公用命令:退出命令:exit 保存配置:wirte memory (保存到路由器的NVRAM)write network tftp (保存到TFTP服务器)删除配置:Write erase 网络检测命令:telnet ping trace show (这几个命令应该重点了解下他们的作用和使用方法)3、端口配置:进入:interface(端口)4、端口带宽:bandwidth (单位为Kbps)5、开关端口:shutdown no shutdown6、配置接口地址:ip address (ip地址)(子网掩码)7、配置POS接口:先进入接口模式Crc 32 (可选的crc校验位是16 或32)Pos farming sdh (可选的帧格式是sdh和sonet)Pos flag s1 s0 2 (s1 s0 =00 表示sonet帧的数据S1 s0=10(十进制的2)表示是SDH的帧数据)8、loopback接口配置:int loopback 0ip address (ip 地址)(子网掩码)no ip route-cacheno ip mroute-cache9、配置静态路由:ip rpute (目的网络地址)(子网掩码)(下一跳路由器地址)10、配置RIP动态协议:router ripNetwork (网络地址)--记住只写上网络地址即可。

[进阶阅读] 交换机&路由器命令大全(带中文注释)

router#show frame map ;显示映射
基本访问控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;defaultut
router(config-router)#negihbor ;点对点帧中继用。
帧中继命令:
router(config)#frame-relay switching ;使能帧中继交换
router(config-s0)#encapsulation frame-relay ;使能帧中继
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch#exit ;返回命令
交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
router#reload ;重新引导
路由器文件操作:
router#copy running-config startup-config ;保存配置

交换机和路由器命令

Router#:conf t 进入全局模式
Router(config)#int f 端口 进入端口模式
Router(config-if)#:ip address ip+子网掩码 配置IP和子网掩码
Switch(config-if)#:switchport trunk allowed vlan remove vlan-id Trunk中删除VLAN
Switch(vlan)#:exit 退出和保存
全局模式下创建VLAN
Switch(config)#:vlan vlan-id 创建vlanID
Switch(config-vlan)#:name 名字 设置vlan名称
address or name of remote host[] ? 填写FTP服务器IP地址
Destination filename [c2600-i-mz.122-28.bin]? 填写目标文件名
FTP升级或还原路由器镜像
Trunk配置
Switch(config)#:interface {FastEthernet GigabitEthernet} slot/port 进入端口
Switch(config-if)#:switchport trunk encapsulation {isl dot1q negotiate} 选择封装类型
Source filename[]? 填写FTP服务器上路由镜像
Destination filename (IOS文件名) 确认回车
FTP备份路由器镜像
Router(config)#:ip ftp username 用户名 在路由器上配置ftp的用户名
扩展知识:(config)#:username 设备用户名 password 设备密码

华为路由器交换机配置命令大全

华为路由器交换机配置命令大全华为路由器交换机配置命令大全一、登录与认证命令1.Telnet 登录命令2.SSH 登录命令3.Console 登录命令4.用户认证命令二、设备管理命令1.设备信息查看命令2.设备参数配置命令3.设备重启命令4.设备保存配置命令三、接口配置命令1.查看接口状态命令2.配置接口描述命令3.配置接口IP地质命令4.配置接口MTU命令5.开启/关闭接口命令四、路由配置命令1.配置静态路由命令2.配置默认路由命令3.配置动态路由命令4.查看路由表命令5.清空路由表命令五、VLAN 配置命令1.配置VLAN命令2.配置端口VLAN命令3.配置VLAN接口命令六、交换机功能配置命令1.配置端口镜像命令2.配置链路聚合命令3.配置交换机端口安全命令4.配置交换机QoS命令七、安全配置命令1.配置访问控制列表命令2.配置NAT命令3.配置防火墙命令4.配置SSL VPN命令附录:附件:1.示例配置文件2.常见问题解答法律名词及注释:1.Telnet:一种远程登录协议,用于远程连接路由器或交换机进行管理和配置。

2.SSH:Secure Shell,一种用于远程登录的网络协议,提供安全的数据通信和用户认证方式。

3.Console:一种通过串口连接设备进行本地登录的方式。

4.VLAN:Virtual Local Area Network,虚拟局域网,将不同的物理分组划分到不同的逻辑分组中,实现逻辑分离。

5.MTU:Maximum Transmission Unit,最大传输单元,指数据链路层上一次发送的帧的最大长度。

6.NAT:Network Address Translation,网络地质转换,用于在私有网络和公共网络之间进行通信的转换技术。

7.QoS:Quality of Service,服务质量,用于在网络通信中对不同数据流进行优先级和带宽控制。

路由器交换机配置口令大全

一、路由器配置>Enable 进入特权模式#Ex IT返回上一级操作模式#del flash:config.text 删除配置文件(交换机及1700系列路由器)#erase startup-config 删除配置文件(2500系列路由器)#write memory 或copy running-config startup-config 保存配置#Configure terminal 进入全局配置模式(config)# hostname routerA 配置设备名称为routerA(config)#banner motd & 配置每日提示信息&为终止符(config)# enable secret star 或者:enable password star设置路由器的特权模式密码为star;secret 指密码以非明文显示,password指密码以明文显示查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show ip interface brief 查看端口信息#show version 查看版本信息#show running-config 查看当前生效的配置信息#show controllers serial 1/2 查看该端口信息, 用于R2501#show ip route 查看路由表信息#show access-lists 1 查看标准访问控制列表1的配置信息远程登陆(telnet)(config)# line vty 0 4 进入线路0~4的配置模式,4为连续线路最后一位的编号,线路为0~4 (conifg-line)#login(config-line)#password star 配置远程登陆密码为star(config-line)#end 返回上层端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2 进入F01至F0/2的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应) (config-if)#no shutdown 开启该端口(config)# interface serial 1/2 进入端口S1/2的配置模式(config-if)# ip address 1.1.1.1 255.255.255.0 配置端口IP及掩码(config-if)# clock rate 64000 配置时钟频率(单位为K , 仅用于DCE端)(config-if)# bandwidth 512 配置端口带宽速率为512KB(单位为KB)(config-if)# no shutdown 开启该端口(config-if)#encapsulation PPP 定义封装类型为PPP,可选项:Frame-relay 帧中继Hdlc 高级数据链路控制协议lapb X.25的二层协议PPP PPP点到点协议X25 X.25协议路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)(config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)注意:如果是Rip Version1,那么在不连续的子网中,需要为中间网段的两个路由器都配置子接口!!!RA(config)#int serial0RA(config-if)#ip address 172.16.2.1 255.255.255.0 secondaryRB(config)#int serial0RB(config-if)#ip address 172.16.2.2 255.255.255.0 secondaryPAP路由器Ra为被验证方、Rb为验证方;两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:Rb(config)# username Ra password 0 star 验证方配置被验证方的用户名,密码Rb(config)# intterface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation ppp 定义封装类型为PPPRb(config-if)# ppp authentication pap PPP启用PAP认证方式Ra(config)# itnterface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation ppp 定义封装类型为PPPRa(config-if)# ppp pap sent-username Ra password 0 star 设置用户名为ra 密码为star,用于发送到验证方进行验证#debug ppp authentication 可选命令:观察PAP验证过程(如果没看到验证消息,则将端口shutdown,然后再no shutdown,即可看到验证过程的相关信息)CHAP路由器Ra、Rb, 两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:被验证方配置:Ra(config)# username Rb password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)# interface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation PPP 定义封装类型为PPP验证方配置:Rb(config)# username Ra password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)# interface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation PPP 定义封装类型为PPPRb(config-if)# ppp authentication chap PPP启用CHAP方式验证PAP与CHAP的区别:1. PAP:被验证方发送用户名、密码到验证方进行身份验证,所以需要在端口模式下设置Ra(config)#ppp pap sent-username Ra password 0 star;验证方需要定义用户和密码配对数据库记录,所以要定义命令:Rb(config)# username Ra password 0 star2. Chap:CHAP由验证方主动发起挑战,由被验证方应答进行验证(三次握手),所以验证方要配置命令:Rb(config-if)# ppp authentication chap。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第九章配置命令总结第一节各种模式图9-1 各种模式关系图表9-1 各种模式表另外还有一些模式:1、标准命名ACLSW1(config)#ip access-list standard deny-host!deny-hos t为名字SW1(config-std-nacl)# !表示进入标准命名ACL 2、扩展命名ACLSW2(config)#ip access-list extended permit-host!permit-host为名字SW2(config-ext-nacl)# !表示进入扩展命名ACL 3、时间控制模式R1(config)#time-range time-range-name!time-range-name为名字R1(config-time-range)# !表示进入时间控制模式其中最基本的四种模式是:用户模式,特权模式,全局配置模式,接口模式。

第二节路由器与交换机基本配置1、配置主机名:hostnameSwitch> EnSwitch# Conf tSwitch(config)# Hostname“主机名”2、显示版本信息:sh verSwitch# sh ver3、显示配置信息:sh runSwitch# sh run4、保存配置:Write 或 copy run starSwtich# wrSwtich# copy run star5、显示已保存的信息:sh starSwitch# sh star6、删除已保存的配置信息:Erase Nvram 或 delete nvram:startup-configSwitch# erase NvramSwitch# delete nvram:startup-config7、配置密码(1)配置Console口密码(开机密码)Switch(config)#line console 0Switch(config-line)#password switch !表示密码为:swtichSwitch(config-line)#login删除密码:no login(2)配置特权模式密码(Enable密码)Switch(config)#enable password switch1 !表示设置明文密码为switch1 删除密码:No enable passwordSwitch(config)#enable secret switch2 !表示设置密文密码为switch2 删除密码:No enable secret(3)配置远程登录密码(Telnet密码或称VTY密码)远程访问时必须配置VTY密码和特权模式密码Switch(config)#Line vty 0 4Switch(config-line)#password switch !表示密码为:swtichSwitch(config-line)#login删除密码:no login8、加密明文密码:Ser passSwitch(config-line)# ser pass第三节交换机及VLAN的配置1、Vlan基本命令(1)创建VlanSwitch#Vlan databaseSwitch(vlan)#Vlan编号name名称!编号用数字,但不能是1,名称可以用字符和数字(2)删除VlanSwitch(vlan)# No vlan编号(3)把接口加入VlanSwitch(config)#Int接口Switch(config-if)#Switchport accesss vlan编号(4)把多个接口加入VlanSwitch(config)#Int range接口范围Router(config-if-range)# Switchport accesss vlan编号(5)把某个接口恢复原状(从Vlan中删除)Switch(config)#default interface某个具体接口(6)显示Vlan配置情况Switch# Show vlan-sw(7)多交换机之间Vlan(设定接口为Trunk链路)Switch(config)#interface接口Switch(config-if)#switchport mode trunk!设定trunk链路(8)显示Trunk配置情况Switch# Show inter trunk3、三层交换机的接口之间的转换interface接口!进入某接口no switchport!把三层交换机的某接口升级为三层接口switchport!把三层接口降级为二层接口4、配置VlanIP地址Int vlan 1(进入某个具体Vlan)Ip address x.x.x.x(IP地址) x.x.x.x(子网掩码)No shutInt vlan 1No ip address x.x.x.x(IP地址) x.x.x.x (子网掩码)!删除IP5、VLAN间路由ip routing!启用交换机的路由功能(交换机不同,要求不同)Int vlan编号1(如Vlan 10)Ip address x.x.x.x(IP地址) x.x.x.x(子网掩码)Int vlan编号2(如Vlan 20)Ip address x.x.x.x(IP地址) x.x.x.x(子网掩码)6、链路聚合一、思科某些产品(两台交换机配置相同):SW1(config)#int range f0/1 – 2!进入接口范围模式,捆绑F0/1,F0/2SW1(config-if-range)#channel-group 1 mode on!设置聚合通道组号为1,并开启在接口模式下用“no channel-group”命令删除某一个聚合端口成员。

SW1(config)#int f0/1SW1(config-if)#no channel-group!表示把F0/1端口从聚合中删除二、锐捷公司产品:(两台交换机配置相同)SW1#(config)#int aggregateport 1 !创建聚合端口1(非必须步骤)SW1#(config)#swit mode trunk !将该端口配置为Trunk链路(非必须步骤)SW1#(config)#int range F0/1 – 2SW1#(config-if-range)#port-group 1SW1#(config-if-range)#no shut锐捷公司产品可以用show aggregateport 1 summary,来查看在接口模式下用“no port-group”命令删除某一个聚合端口成员8、交换机端口安全(1)端口工作方式Duplex auto/full/half其中auto,表示端口的工作模式为自动协商模式,即交换机端口根据所连设备的速率来自动确定其工作速率。

full,表示强制进入全双工模式。

half,表示强制进入半双工模式。

(2)端口最大连接数Swit port-security maximum Value !Value是最大连接数量(3)MAC(或IP)地址绑定Swit port-security mac-address macadd或:swit port-security ip-address ipadd其中macadd和ipadd,指的是具体的MAC地址和IP地址。

例如:Switch(config)#int f0/0Switch(config-if)#swit port-security !开启端口安全功能Switch(config-if)#swit port-security mac-address 0025.11A3.5030!将mac地址00-25-11-A3-50-30绑定到f0/0端口第四节路由器的配置1、配置接口IP地址Int E0/0 !进入某具体接口Ip address x.x.x.x(接口地址) x.x.x.x(子网掩码)No shut!开启端口No ip address!删除该接口IP地址show ip inter!查看路由器各个端口的情况2、配置VlanIP地址Int vlan 1 !进入某个具体VlanIp address x.x.x.x(IP地址) x.x.x.x(子网掩码)No shutInt vlan 1No ip address x.x.x.x x.x.x.x !删除IP地址3、路由表的配置(静态路由)Ip route目的网络号子网掩码本地接口/下一跳IP地址No ip route目的网络号子网掩码本地接口/下一跳IP地址!删除某静态路由Show ip route!显示路由表,查看路由信息Show IP inter brief!显示各个接口情况sh int某一具体接口(E0/0等)!显示某一具体接口配置默认路由IP route目标网段(包括子网掩码)本地端口/下一跳IP地址!其中目标网段固定为:0.0.0.0,子网掩码固定为:0.0.0.0 这个命令可以写成:IP route 0.0.0.0 0.0.0.0 本地端口/下一跳IP地址4、动态路由配置(RIP)Router(config)#router rip!启用RIPRouter(config-router)#network x.x.x.x 直连网段默认路由Router(config-router)#network 0.0.0.05、动态路由配置(OSPF)(1)在全局配置模式下启动OSPF,进入OSPF路由协议配置模式:Router(config)#Router ospf process-id其中process-id是用来在这个路由器接口上启动的OSPF的唯一标识。

Process-id可以作为识别一台路由器上是否运行着多个OSPF进程的依据。

Process-id的取值范围为1——65535。

一个路由器的每个接口都可以选择不同的id,但一般来说不推荐在路由器上运行多个OSPF,因为多个id会有多个拓扑数据库,给路由器造成额外负担。

(2)发布OSPF的网络号和指定端口所在区域号:Router(config-router)#network address wildcard area area-idAddress wildcard:表示运行OSPF端口所在网络网段地址以及相应的子网掩码的反码。

例如192.168.1.0/24,网段是:192.168.1.0,子网掩码是:255.255.255.0,子网掩码的反码是:0.0.0.255。

反码就是按位变反,1变0,0变1。

如:255.0.0.0的反码是:0.255.255.255。

那么192.168.1.0 0.0.0.255表示192.168.1.0——192.168.1.255这个地址范围,这个0.0.0.255表示通配符。

相关文档
最新文档