(设备管理)常用网络设备配置命令及配置实例
- 格式:doc
- 大小:175.57 KB
- 文档页数:8
H3C交换机配置命令快速入门H3C是一家领先的网络设备制造商,在企业网络中广泛使用。
本文将介绍H3C交换机配置命令的快速入门,帮助您快速掌握常用的配置命令,以便于您更好地管理和维护您的企业网络。
进入配置模式首先,我们需要进入交换机的配置模式。
在命令行界面输入“system-view”即可进入配置模式。
设置交换机的主机名为了便于管理多台交换机,我们需要给每台交换机设置一个唯一的主机名。
在配置模式下输入“hostname [主机名]”即可设置主机名。
例如,设置主机名为“Switch1”,则输入命令“hostname Switch1”。
设置管理用户和密码为了保障交换机的安全性,我们需要设置管理用户和密码。
在配置模式下输入“local-user [用户名] password cipher [密码]”即可设置管理用户和密码。
例如,设置用户名为“admin”,密码为“123456”,则输入命令“local-user admin password cipher 123456”。
配置交换机IP地址在企业网络中,我们需要为交换机配置IP地址,以便于进行网络管理和维护。
在配置模式下输入“interface vlan [VLAN号]”进入VLAN配置界面,然后输入“ip address [IP 地址] [子网掩码]”配置IP地址。
例如,配置VLAN号为10,IP地址为192.168.1.1,子网掩码为255.255.255.0,则输入命令“interface vlan 10”和“ip address 192.168.1.1 255.255.255.0”。
配置交换机端口在企业网络中,我们需要配置交换机的端口以实现不同设备之间的通信。
在配置模式下输入“interface [端口号]”进入端口配置界面,然后输入“port link-type [链路类型]”配置链路类型。
例如,配置端口号为1/0/1,链路类型为access,则输入命令“interface 1/0/1”和“port link-type access”。
H3C交换机配置命令1、system-view 进入系统视图模式2、sysname 为设备命名3、display current-configuration 当前配置情况4、 language-mode Chinese|English 中英文切换5、interface Ethernet 1/0/1 进入以太网端口视图6、 port link-type Access|Trunk|Hybrid 设置端口访问模式7、 undo shutdown 打开以太网端口8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式10、 vlan 10 创建VLAN 10并进入VLAN 10的视图模式11、 port access vlan 10 在端口模式下将当前端口加入到vlan 10中12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中13、port trunk permit vlan all 允许所有的vlan通过H3C路由器1、system-view 进入系统视图模式2、sysname R1 为设备命名为R13、display ip routing-table 显示当前路由表4、 language-mode Chinese|English 中英文切换5、interface Ethernet 0/0 进入以太网端口视图6、 ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码7、 undo shutdown 打开以太网端口8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式10、 ip route-static 192.168.2.0 255.255.255.0 192.168.12.2 description To.R2 配置静态路由11、 ip route-static 0.0.0.0 0.0.0.0 192.168.12.2 description To.R2 配置默认的路由H3C S3100 SwitchH3C S3600 SwitchH3C MSR 20-20 Router1、调整超级终端的显示字号;2、捕获超级终端操作命令行,以备日后查对;3、 language-mode Chinese|English 中英文切换;4、复制命令到超级终端命令行,粘贴到主机;5、交换机清除配置 :<H3C>reset save ;<H3C>reboot ;6、路由器、交换机配置时不能掉电,连通测试前一定要检查网络的连通性,不要犯最低级的错误。
一、交换机基本配置1、交换机命名:在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。
switch(config)#hostname ruijie //ruijie为该交换机的名字2、交换机配置管理密码:配置密码可以提高交换机的安全性,另外,telnet登录交换机的时候,必须要求有telnet管理密码。
switch (config)#enable secret level 1 0 rg //配置telnet管理密码为rg,其中1表示telnet密码,0表示密码不加密switch (config)#enable secret level 15 0 rg //配置特权模式下的管理密码rg,其中15表示为特权密码3、交换机配置管理IPswitch (config)#interface vlan 1 //假设管理VLAN为VLAN 1switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令4、交换机配置网关:switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。
通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。
二、接口介质类型配置锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。
但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。
1、接口介质类型的转换:Switch(config)#interface gigabitethernet 0/25-28Interface fastethernet 0/2Switch(config-if)#medium-type fiber //把接口工作模式改为光口Switch(config-if)#medium-type copper //把接口工作模式改为电口默认情况下,接口是工作在电口模式在项目实施中,如果光纤模块指示灯不亮,工作模式是否正确也是故障原因之一。
ZTE交换机配置常用命令汇总(摘自网络)个人心得:命令的使用要注意各种用户模式。
配成普通交换机:把2-24端口归到VLAN1下,2-24端口如果互相隔离,可以用PVLAN 删除隔离端口即可。
2852s和2826s配置:创建VLAN命令如下:set vlan 10 enable ///创建vlanset vlan 10 add port 1-24 untag ///在创建的vlan内添加用户端口set vlan 10 add port 25 tag ///把级联端口添加到vlan10中,需打tag标签,即为trunk端口。
set port 1-24 pvid 10 ///把添加到vlan10的用户端口,pvid至vlan10中。
交换机用户端口必须在所添加的vlan中做此项命令。
(默认的pvid为vlan10)删除vlan命令如下:set vlan 10 delete port 1-24 ///删除用户端口set vlan 10 delete port 25 ///删除级联端口set vlan 10 disable ///删除vlanset port 1-24 pvid 1 ///恢复默认设置,该项命令必须添加,不然还会在show running-config 信息中显示set port 1-24 pvid 10的信息,会导致vlan用户使用不正常。
ENABLE密码配置:zte>enable //进入全局配置模式password:***** //输入进入全局配置模式的密码,缺省没有密码zte(cfg)#adminpass zxr10 //配置进入全局配置模式的密码为zxr10TELNET 用户名密码配置(为了便于对设备的维护,有时需要修改登录用户名或密码,配置如下:)zte(cfg)#create user zxr10 //创建名为zxr10的用户zte(cfg)#loginpass zxr10 //设置登录密码为zxr10zte(cfg)#show user //显示telnet登录用户信息和当前用户名配置三层管理或业务地址:config router ///进入config router模式set ipport 0 ipaddress 10.20.20.1 255.255.255.0 ///设置三层接口ip地址及掩码set ipport 0 vlan 10 ///三层端口绑定vlanset ipport 0 enable ///启用三层端口iproute 0.0.0.0 0.0.0.0 10.20.20.1 ///设置默认路由指向网关T40G和5228交换机配置:批量创建vlan方式:zxr10#vlan databasezxr10(vlan)#vlan 10-20这样子10-20号连续的vlan就创建起来了,适合批量创建vlan。
华为、H3C、锐捷三家交换机配置命令详解一、华为交换机基础配置命令1<Quidway> //用户视图,也就是在Quidway模式下运行命令。
<Quidway>system-view //进入配置视图[Quidway] vlan 10 //创建vlan 10,并进入vlan10配置视图,如果vlan10存在就直接进入vlan10配置视图[Quidway-vlan10] quit //回到配置视图[Quidway] vlan 100 //创建vlan 100,并进入vlan100配置视图,如果vlan10存在就直接进入vlan100配置视图[Quidway-vlan100] quit //回到配置视图2[Quidway] interface GigabitEthernet2/0/1 (10G光口)[Quidway- GigabitEthernet2/0/1] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100 [Quidway- GigabitEthernet2/0/1] quit //回到配置视图[Quidway] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口配置视图中。
0代表1号口[Quidway- GigabitEthernet1/0/0] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 10 //将这个端口加入到vlan10中[Quidway- GigabitEthernet2/0/1] quit3<Quidway>system-view[Quidway]vlan 10[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中[Quidway-vlan10]quit4[Quidway] interface Vlanif100 // 进入vlan100接口视图与vlan 100命令进入的地方不同[Quidway-Vlanif100] ip address 119.167.200.90 255.255.255.252 // 定义vlan100管理IP三层交换网关路由[Quidway-Vlanif100] quit //返回视图[Quidway] interface Vlanif10 // 进入vlan10接口视图与vlan 10命令进入的地方不同[Quidway-Vlanif10] ip address 119.167.206.129 255.255.255.128 // 定义vlan10管理IP三层交换网关路由[Quidway-Vlanif10] quit5[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默认网关。
数通设备配置学习手工配置路由器基础配置路由器实际上就是对DRAM(动态内存)中的正在执行的路由器配置文件(running-config)进行配置(注意:路由器的配置是及时生效的),然后在确认配置正确后,保存正在执行的路由器配置文件(running-config)到NVRAM中的启动路由器配置文件(startup-config)中,以便于在下次启动后采用。
路由器配置文件是一个ASCII文本文件。
系统引导时会读取这个文本文件,并且路由器操作系统IOS 会将其置为有效的配置。
在路由器运行期间,可以通过输入一些命令来进入路由器配置模式,这些命令将会增加、修改或删除配置选项。
一些路由器简单常用命令的整理CISCO#hostname ExampleName//配置host主机名称#ctrl-Z //退到父辈,如从config退到enable模式#enable secret examplepassword //在conf模式设置特权模式口令#ip name-server /doc/cb032ce3524de518964b7ddf.html .dd //配置路由器所用DNSshow ? //将显示所有可用于当前模式的show命令> //路由器处于RXBOOT状态,在开机后60秒内按ctrl-break 可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导SETUP //这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置改变命令状态enable //进入特权命令状态disable//退出特权命令状态setup//进入设置对话状态config terminal //进入全局设置状态end//退出全局设置状态interface type slot/number//进入端口设置状态interface type number.subinterface [point-to-point | multipoint] //进入子端口设置状态line type slot/number//进入线路设置状态router protocol//进入路由设置状态exit//退出局部设置状态显示命令show version //查看版本及引导信息show running-config //查看运行设置show startup-config //查看开机设置show interface type slot/number //显示端口信息show ip router //显示路由信息网络命令telnet hostname|IP address //登录远程主机ping hostname|IP address //网络侦测trace hostname|IP address //路由跟踪基本设置命令config terminal //全局设置username username password password //设置访问用户及密码enable secret password //设置特权密码hostname name //设置路由器名ip route destination subnet-mask next-hop //设置静态路由ip routing //启动IP路由ipx routing //启动IPX路由interface type slot/number//端口设置ip address address subnet-mask //设置IP地址ipx network network //设置IPX网络no shutdown //激活端口line type number //物理线路设置login [local|tacacs server]//启动登录进程password password //设置登录密码分配接口IP地址interface type slot/number //分配接口IP地址ip address ip-address mask //为接口设置IP地址配置IP寻址NAT(Network Address Translation)//网络地址翻译,起到将内部私有地址翻译成外部合法的全局地址的功能,它使得不具有合法IP 地址的用户可以通过NAT访问到外部Internet.定义一个标准访问列表access-list access-list-number permit source [source-wildcard]如:access-list 1 permit 192.200.0.0 0.0.255.255定义一个全局地址池ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}[type rotary]如:ip nat pool GPRS 217.218.231.151 217.218.231.156 netmask 255.255.255.240建立动态地址翻译ip nat inside source {list {access-list-number | name} pool name [overload] | static local-ipglobal-ip}如:ip nat inside source list 1 pool GPRS overload指定内部和外部端口ip nat {inside | outside}配置静态路由通过配置静态路由,用户可以人为地指定对某一网络访问时所要经过的路径,在网络结构比较简单,且一般到达某一网络所经过的路径唯一的情况下采用静态路由。
ZTE交换机配置常用命令汇总(摘自网络)个人心得:命令的使用要注意各种用户模式。
配成普通交换机:把2-24端口归到VLAN1下,2-24端口如果互相隔离,可以用PVLAN 删除隔离端口即可。
2852s和2826s配置:创建VLAN命令如下:set vlan 10 enable ///创建vlanset vlan 10 add port 1-24 untag ///在创建的vlan内添加用户端口set vlan 10 add port 25 tag ///把级联端口添加到vlan10中,需打tag标签,即为trunk端口。
set port 1-24 pvid 10 ///把添加到vlan10的用户端口,pvid至vlan10中。
交换机用户端口必须在所添加的vlan中做此项命令。
(默认的pvid为vlan10)删除vlan命令如下:set vlan 10 delete port 1-24 ///删除用户端口set vlan 10 delete port 25 ///删除级联端口set vlan 10 disable ///删除vlanset port 1-24 pvid 1 ///恢复默认设置,该项命令必须添加,不然还会在show running-config 信息中显示set port 1-24 pvid 10的信息,会导致vlan用户使用不正常。
ENABLE密码配置:zte>enable //进入全局配置模式password:***** //输入进入全局配置模式的密码,缺省没有密码zte(cfg)#adminpass zxr10 //配置进入全局配置模式的密码为zxr10TELNET 用户名密码配置(为了便于对设备的维护,有时需要修改登录用户名或密码,配置如下:)zte(cfg)#create user zxr10 //创建名为zxr10的用户zte(cfg)#loginpass zxr10 //设置登录密码为zxr10zte(cfg)#show user //显示telnet登录用户信息和当前用户名配置三层管理或业务地址:config router ///进入config router模式set ipport 0 ipaddress 10.20.20.1 255.255.255.0 ///设置三层接口ip地址及掩码set ipport 0 vlan 10 ///三层端口绑定vlanset ipport 0 enable ///启用三层端口iproute 0.0.0.0 0.0.0.0 10.20.20.1 ///设置默认路由指向网关T40G和5228交换机配置:批量创建vlan方式:zxr10#vlan databasezxr10(vlan)#vlan 10-20这样子10-20号连续的vlan就创建起来了,适合批量创建vlan。
思科路由器常用配置命令一览表:1、Exec commands:<1-99> 恢复一个会话bfe 手工应急模式设置clear 复位功能clock 管理系统时钟configure 进入设置模式connect 打开一个终端copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug 调试功能disable 退出优先命令状态disconnect 断开一个网络连接enable 进入优先命令状态erase 擦除快闪内存exit 退出exce模式help 交互帮助系统的描述lat 打开一个本地传输连接lock 锁定终端login 以一个用户名登录logout 退出终端mbranch 向树形下端分支跟踪多路由广播mrbranch 向树形上端分支跟踪反向多路由广播name-connection 给一个存在的网络连接命名no 关闭调试功能pad 打开X.29 PAD连接ping 发送回显信息ppp 开始点到点的连接协议reload 停机并执行冷启动resume 恢复一个活动的网络连接rlogin 打开远程注册连接rsh 执行一个远端命令send 发送信息到另外的终端行setup 运行setup命令show 显示正在运行系统信息slip 开始SLIP协议start-chat 在命令行上执行对话描述systat 显示终端行的信息telnet 远程登录terminal 终端行参数test 测试子系统内存和端口tn3270 打开一个tin3270连接trace 跟踪路由到目的地undebug 退出调试功能verify 验证检查闪烁文件的总数where 显示活动的连接which-route 执行OSI路由表查找并显示结果write 把正在运行的设置写入内存、网络、或终端x3 在PAD上设置X.3参数xremote 进入xremote模式2、#show ?access-expression 显示访问控制表达式access-lists 显示访问控制表apollo Apollo 网络信息appletalk Apple Talk 信息arap 显示Appletalk 远端通道统计arp 地址解析协议表async 访问路由接口的终端行上的信息bridge 前向网络数据库buffers 缓冲池统计clns CLNS网络信息clock 显示系统时钟cmns 连接模式网络服务信息compress 显示压缩状态configuration 非易失性内存的内容controllers 端口控制状态debugging 调试选项状态decnet DEC网络信息dialer 拨号参数和统计dnsix 显示Dnsix/DMPP信息entry 排队终端入口extended 扩展端口信息flash 系统闪烁信息flh-log 闪烁装载帮助日志缓冲区frame-relay 帧中继信息history 显示对话层历史命令hosts IP域名,查找方式,名字服务,主机表interfaces 端口状态和设置ip IP信息ipx Novell IPX信息isis IS-IS路由信息keymap 终端键盘映射lat DEC LAT信息line 终端行信息llc2 IBM LLC2 环路信息lnm IBM 局网管理local-ack 本地认知虚环路memory 内存统计netbios-cache NetBios命名缓冲存贮器内存node 显示已知LAT节点ntp 网络时间协议processes 活动进程统计protocols 活动网络路由协议queue 显示队列内容queueing 显示队列设置registry 功能注册信息rhosts 远程主机文件rif RIF存贮器入口route-map 路由器信息sdlle 显示sdlc-llc2转换信息services 已知LAT服务sessions 远程连接信息smds SMDS信息source-bridge 源网桥参数和统计spanning-tree 跨越树形拓朴stacks 进程堆栈应用standby 热支持协议信息stun STUN状态和设置subsystem 显示子系统tcp TCP连接状态terminal 显示终端设置tn3270 TN3270 设置translate 协议转换信息ttycap 终端容易表users 显示终端行的信息version 系统硬、软件状态vines VINES信息whoami 当前终端行信息x25 X.25信息xns XNS信息xermote Xremote统计3、#config ?Memory 从非易失性内存设置Network 从TFTP网络主机设置Overwrite-network 从TFTP网络主机设置覆盖非易失性内存Terminal 从终端设置4、Configure commads:Access-list 增加一个访问控制域Apollo Apollo全局设置命令appletalk Appletalk 全局设置命令arap Appletalk远程进出协议arp 设置一个静态ARP入口async-bootp 修改系统启动参数autonomous-system 本地所拥有的特殊自治系统成员banner 定义注册显示信息boot 修改系统启动时参数bridge 透明网桥buffers 调整系统缓冲池参数busy-message 定义当连接主机失败时显示信息chat-script 定义一个调制解调器对话文本clns 全局CLNS设置子命令clock 设置时间时钟config-register 定义设置寄存器decnet 全局DEC网络设置子命令default-value 缺省字符位值dialer-list 创建一个拨号清单入口dnsix-nat 为审计提供DMDM服务enable 修改优先命令口令end 从设置模式退出exit 从设置模式退出frame-relay 全局帧中继设置命令help 交互帮助系统的描述hostname 设置系统网络名iterface 选择设置的端口ip 全局地址设置子命令ipx Novell/IPX全局设置命令keymap 定义一个新的键盘映射lat DEC本地传输协议line 设置终端行lnm IBM局网管理locaddr-priority-list 在LU地址上建立优先队列logging 修改注册(设备)信息login-string 定义主机指定的注册字符串map-class 设置静态表类map-list 设置静态表清单menu 定义用户接口菜单mop 设置DEC MOP服务器netbios NETBIOS通道控制过滤no 否定一个命令或改为缺省设置ntp 设置NTPpriority-list 建立特权列表prompt 设置系统提示符queue-list 建立常规队列列表rcmd 远程命令设置命令rcp-enable 打开Rep服务rif 源路由进程router-map 建立路由表或进入路由表命令模式router 打开一个路由进程rsh-enable 打开一个RSH服务sap-priority-list 在SAP或MAC地址上建立一个优先队列service 修改网络基本服务snmp-server 修改SNMP参数state-machine 定义一个TCP分配状态的机器stun STUN全局设置命令tacacs-server 修改TACACS队列参数terminal-queue 终端队列命令tftp-server 为网络装载请求提供TFTP服务tn3270 tn3270设置命令translate 解释全局设置命令username 建立一个用户名及其权限vines VINES全局设置命令x25 X.25 的第三级x29 X.29 命令xns XNS 全局设置命令xremote 设置Xremote5、(config)#ipGlobal IP configuration subcommands:Accounting-list 选择保存IP记帐信息的主机Accounting-threshold 设置记帐入口的最大数accounting-transits 设置通过入口的最大数alias TCP端口的IP地址取别名as-path BGP自治系统路径过滤cache-invalidate-delay 延迟IP路由存贮池的无效classless 跟随无类前向路由规则default-network 标志网络作为缺省网关候选default-gateway 指定缺省网(如果没有路由IP)domain-list 完成无资格主机的域名domain-lookup 打开IP域名服务系统主机转换domain-name 定义缺省域名forward-protocol 控制前向的、物理的、直接的IP广播host 为IP主机表增加一个入口host-routing 打开基于主机的路由(代理ARP和再定向)hp-host 打开HP代理探测服务mobile-host 移动主机数据库multicast-routing 打开前向IPname-server 指定所用名字服务器的地址ospf-name-lookup 把OSPF路由作为DNS名显示pim PIM 全局命令route 建立静态路由routing 打开IP路由security 指定系统安全信息source-route 根据源路由头的选择处理包subnet-zero 允许子网0子网tcp 全局TCP参数路由器配置命令详细列表【内容摘要】cisco路由配置语句汇总启动接口,分配ip地址:router>router>enablerouter#router#configureterminalrouter(config)#router(config)#interfacetypeportrouter(config-if)#noshutdownrouter(config-if)#ipaddressip-addresssubnet-maskrouter(config-if)#^z配置rip路由协议:30秒更新一次router(config)#routerriprouter(config-if)#……-----------------------------------------------------------------------------cisco路由配置语句汇总启动接口,分配ip地址:router>router> enablerouter#router# configure terminalrouter(config)#router(config)# interface type portrouter(config-if)# no shutdownrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# ^z配置rip路由协议:30秒更新一次router(config)# router riprouter(config-if)# network network-number <——通告标准a,b,c类网——>router(config-if)# ^z配置igrp路由协议:90秒更新一次router(config)# router igrp as-number <——as-number范围1~65535——>router(config-if)# network network-number <——通告标准a,b,c类网——>router(config-if)# ^z配置novell ipx路由协议:novell rip 60秒更新一次router(config)# ipx routing [node address]router(config)# ipx maximum-paths paths <——设置负载平衡,范围1~512——> router(config)# interface type portrouter(config-if)# ipx network network-number [encapsulation encapsulation-type] [secondary] <——通告标准a,b,c类网——>router(config-if)# ^z配置ddr:router(config)# dialer-list group-number protocol protocol-type permit [listacl-number]router(config)# interface bri 0router(config-if)# dialer-group group-numberrouter(config-if)# dialer map protocol-type next-hop-address name hostname telphone-numberrouter(config-if)# ^z配置isdn:router(config)# isdnth-typeth-type <——配置isdn交换机类型,中国使用basic-net3——>router(config-if)# ^z配置frame relay:router(config-if)# encapsulation frame-relay [cisco | ietf ]router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ]router(config-if)# bandwidth kilobitsrouter(config-if)# frame-relay invers-arp [ protocol ] [dlci ]<——配置静态invers arp表:router(config)# frame-relay protocol protocol-address dlci [ broadcast ] [ ietf | cisco ] [ payload-compress | packet-by-packet ]——><——设置keepalive间隔:router(config-if)# keepalive number——><——为本地接口指定dlci:router(config-if)# frame-lelay local-dlci number——><——子接口配置:router(config-if)# interface type port.subininterface-number [ multipoint |point-to-point ]router(config-subif)# ip unnumbered interfacerouter(config-subif)# frame-lelay local-dlci number——>router(config-if)# ^z配置标准acl:router(config)# access-list access-list-number [ permit | deny ] source [ source-mask ] <——access-list-number 范围:1~99标准acl;100~199扩展acl;800~899标准ipx acl;900~999扩展ipx acl;1000~1099 ipx sap acl;600~699apple talk acl——> router(config)# interface type portrouter(config-if)# ip access-group access-list-number [ in | out ]router(config-if)# ^z配置扩展acl:router(config)# access-list access-list-number [ permit | deny ] [ protocol | protocol-number ] source source-wildcard [ source-port ] destination destination-wildcard [ destination-port ] [ established ]router(config)# interface type portrouter(config-if)# ip access-group access-list-number [ in | out ]router(config-if)# ^z配置命名acl:router(config)# ip access-list [ standard | extended ] acl-namerouter(config [ std- | ext- ] nacl)# [ permit | deny ] [ ip-access-list-test-conditions ] router(config [ std- | ext- ] nacl)# no [ permit | deny ] [ ip-access-list-test-conditions ] router(config [ std- | ext- ] nacl)# ^zrouter(config)# interface type portrouter(config-if)# ip access-group [acl-name | 1~199 ] [ in | out ]router(config-if)# ^z配置dce时钟:router# show controllers type port <——确定dce接口——>router(confin-if)# clock rate 64000 <——进入dce接口设置时钟速率——>router(config-if)# ^z配置ppp协议:router(config)# username name password set-password-here <——验证方建立数据库——>router(config)# interface type portrouter(config-if)# encapsulation ppp <——启动ppp协议——>router(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ] <——选择ppp认证——>router(config-if)# ppp pap sent-username name password password <——发送验证信息——>router(config-if)# ^zpap单向认证配置实例:验证方:router-server(config)# username client password 12345 <——验证方建立数据库——>router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication pap <——选择使用pap实现ppp认证——>router-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username client password 12345 <——发送验证信息——>router-client(config-if)# ^zpap双向认证配置实例:路由器a:routera(config)# username b password 12345routera(config)# interface serial 0routera(config-if)# encapsulation ppproutera(config-if)# ppp authentication paproutera(config-if)# ppp pap sent-username a password 54321routera(config-if)# ^z路由器b:routerb(config)# username a password 54321routerb(config)# interface serial 1routerb(config-if)# encapsulation ppprouterb(config-if)# ppp authentication paprouterb(config-if)# ppp pap sent-username b password 12345routerb(config-if)# ^zchap单向认证配置实例:验证方:router-server(config)# username router-client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication chaprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp authentication chaprouter-client(config-if)# ppp chap hostname router-clientrouter-client(config-if)# ppp chap password 12345router-client(config-if)# ^z chap双向认证配置实例:路由器a:routera(config)# username routerb password 12345routera(config)# interface serial 0routera(config-if)# encapsulation ppproutera(config-if)# ppp authentication chaproutera(config-if)# ppp chap hostname routeraroutera(config-if)# ppp chap password 54321routera(config-if)# ^z路由器b:routerb(config)# username routera password 54321routerb(config)# interface serial 1routerb(config-if)# encapsulation ppprouterb(config-if)# ppp authentication chaprouterb(config-if)# ppp chap hostname routerbrouterb(config-if)# ppp chap password 12345routerb(config-if)# ^ztelnet使用:routera# terminal monitor <——可以传回在远端主机执行debug命令的结果——> routera# telnet ip-address [ router-name ] <——telnet到指定的地址或名字的主机——>routerb# [ exit | logout ] <——退出telnet——>routerb# ++<6>再按<——挂起telnet——>routera# show sessions <——显示当前所有telnet的信息,包括connect-number ——>routera# connect-number <——返回指定的telnet连接——>routera# disconnect ip-address [ router-name ] <——断开指定地址或名字的主机的连接——>routera# show user <——显示telnet到本机的连接信息——>routera# clear line [ 0 | 1 | 2 | 3 | 4 ] <——断开指定telnet到本机的连接——>禁止任何telnet到本机:router(config)# line vty 0 4router(config-line)# access-class acl-numberrouter(config)# ^z设置主机名:router(config)# hostname set-hostnamerouter(config)# ^zrouter(config)# ^z设置用户模式密码:router(config)# line console 0router(config-line)# loginrouter(config-line)# password set-passwordrouter(config-line)# ^z设置telnet密码:router(config)# line vty 0 4router(config-line)# loginrouter(config-line)# password set-passwordrouter(config-line)# ^z设置特权模式密码:router(config)# enable password set-password <——不加密的密码,明码——> router(config)# enable secret set-password <——经过加密的密码——>router(config)# ^z给所有密码加密:router(config)# service password-ancryption set-password-hererouter(config)# no service password-ancryption <——取消加密——>router(config)# ^z设置登录banner:router(config)# banner motd 分隔符set-banner-information-here 分隔符<——前后分隔符一定要一致——>设置接口的描述信息:router(config-if)# description set-port-information-hererouter(config)# ^zcdp的控制:router(config-if)# cdp enable <——在指定端口启用cdp,缺省——>router(config-if)# no cdp enable <——在指定端口关闭cdp——>router(config)# cdp run <——使所有端口启用cdp——>router(config)# no cdp run <——使所有端口关闭cdp——>ping的使用:router# ping ip-addressrouter# ping <——扩展ping命令——>protocol [ip]:[ protocol-type ] <——选择协议类型——>target ip address:ip-address <——输入测试地址——>repeat count [5]:<——选择发送的icmp包数量——>datagram size [100]:<——选择每个包的大小——>timeout in seconds [2]:<——设置每个包的超时时间——>extended commands [n]:y <——使用扩展ping命令——>sweep range of sizes [n]:tracke的使用:router# trace ip-address [ host-name ]为cisco 4000路由器指定媒体类型:router(config-if)# media-type 10baset <——使aui(默认)失效,改为使用rj-45——>router(config-if)# ^z更改路由器启动顺序:router(config)# boot system flash ios-filenamerouter(config)# boot system tftp ios-filename tftp-ip-addressrouter(config)# boot system romrouter(config)# ^z修改寄存器数值:router(config)# config-register value <——cisco出厂默认value=0x2102,value范围:0x2100(进入rom监视器),0x2101(使系统从rom启动),0x2102~0x210f(使系统从nvram启动)。
H3C 交换机配置命令详解华为3COM交换机配置命令详解1、配置文件相关命令[Quidway]display current-configuration ;显示当前生效的配置[Quidway]display saved-configuration ;显示flash中配置文件,即下次上电启动时所用的配置文件<Quidway>reset saved-configuration ;檫除旧的配置文件<Quidway>reboot ;交换机重启<Quidway>display version ;显示系统版本信息2、基本配置[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]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 ;静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 ;进入虚拟终端[S3026-ui-vty0-4]authentication-mode password ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别4、端口配置[Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控[Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]undo shutdown ;激活端口[Quidway-Ethernet0/2]quit ;退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual ;创建手工聚合组1 [DeviceA] interface ethernet 1/0/1 ;将以太网端口Ethernet1/0/1加入聚合组1[DeviceA-Ethernet1/0/1] port link-aggregation group 1[DeviceA-Ethernet1/0/1] interface ethernet 1/0/2 ;将以太网端口Ethernet1/0/1加入聚合组1[DeviceA-Ethernet1/0/2] port link-aggregation group 1[DeviceA] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建Tunnel业务环回组。
附件5 常用网络设备配置命令及配置实例 计算机命令: PCA login: root ;使用root用户 password: linux ;口令是linux # shutdown -h now ;关机 # 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 # telnet ;建立telnet之前先ping一下
^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 显示命令: router#show run ;显示接口 router#show interface ;显示接口 router#show ip route ;显示路由 router#show cdp nei ;看邻居 router#reload ;重新起动
设置口令: router>enable ;进入特权模式 router#config terminal ;进入全局配置模式 router(config)#hostname ;设置交换机的主机名 router(config)#enable secret xxx ;设置特权加密口令为 xxx router(config)#enable password xxx ;设置特权非密口令为 xxx router(config)#line console 0 ;进控制台口(Rs232)初始化 router(config-line)#line vty 0 4 ;进入虚拟终端virtual tty router(config-line)#login ;允许登录 router(config-line)#password xx ;设置登录口令xx router(config)# (Ctrl+z) ; 返回特权模式 router#exit ;返回命令
配置IP地址: router(config)#int s0/0 ;进行串Serail接口 附件5 router(config-if)#no shutdown ;起动接口 router(config-if)#clock rate 64000 ;设置时钟 router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码 router(config-if)#ip add 10.1.1.2 255.255.0.0 second; router(config-if)#int f0/0.1 ; 进入子接口 router(config-subif.1)#ip address ; router(config-subif.1)#encapsulation dot1q ; router(config)#config-register 0x2142 ;跳过配置文件 router(config)#config-register 0x2102 ;正常使用配置文件 router#reload ;重新引导
复制操作: router#copy running-config startup-config ;存配置 router#copy running-config tftp ;上载 router#copy startup-config tftp router#copy tftp flash: ;特权模式下升级IOS router#copy tftp startup-config ;下载配置文件到nvram
ROM状态: Ctrl+Break ;进入ROM监控状态 rommon>confreg 0x2142 ;跳过配置,26 36 45xx rommon>confreg 0x2102 ;使用配置,恢复工作状态 rommon>reset ;重新引导,等效于重开机 rommon>copy xmodem: flash: ;从console升级IOS
rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码 rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;所要下载的文件 rommon>tftpdnld ;ROM监控状态下升级IOS rommon>dir flash: ;查看闪存中的内容 rommon>boot ;引导IOS
静态路由: ip route 例: router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1 router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
动态路由: router(config)#ip routing ;启动路由 router(config)#router rip ;启动RIP路由协议。 router(config-router)#network ;配置范围,有的支持all。 router(config-router)#negihbor ;点对点 帧中继用。 附件5 帧中继命令: router(config)# frame-relay switching ;使能帧中继交换 router(config-s0)# encapsulation frame-relay ;使能帧中继 router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虚电路) router(config-s0)# frame-relay local-dlci 20 ;配置虚电路号
基本访问控制列表: router(config)#access-list permit|deny router(config)#interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^交换机^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 显示命令: switch#write ;写入保存 switch#show vtp switch#show run ;查看当前配置信息 switch#show vlan ;看VLAN switch#show interface ;显示所有端口信息 switch#show int f0/0 ;显示端口0的信息
交换机基本状态: switch: ;ROM状态, 路由器是 rommon> hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ; 接口状态
交换机口令设置: switch>enable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口令为 xxx switch(config)#enable password xxx ;设置特权非密口令为 xxx switch(config)#line console 0 ;进控制台口(Rs232)初始化 switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令
交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 附件5 switch(config)#int f0/1 ;进入端口1 switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2 switch(config-if)#switchport mode trunk ;设置为干线 switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继 switch(config)#vtp domain ; 设置发vtp域名 switch(config)#vtp password switch(config)#vtp mode server switch(config)#vtp mode client
交换机设置IP地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address ;添加远程登录IP switch(config)#ip default-gateway ;添加默认网关 switch#dir flash: ;查看内存
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^实例^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 观察路由器启动流程,确认路由器IOS版本号和硬件信息 察看在User EXEC模式下能够执行的命令 在Privileged EXEC模式下执行以下命令,观察并解释执行结果 1. show version 2. show processes cpu 3. show protocols 4. show interfaces 5. show flash 6. show startup-config 7. show running-config 8. show ip route 9. show mem 命令行编辑 1. 移动到命令行开头 2. 移动到命令行结束 3. 移动到上一个词开始 4. 移动到前一个字符 5. 移动到下一个字符 6. 移动到下一个词 配置路由器识别信息 1. hostname 2. banner motd 3. description 密码设定 主控台密码 line con 0 password abc