路由与交换的配置命令

合集下载

交换机路由器配置命令

交换机路由器配置命令

交换机和路由器配置命令(必须掌握)交换机设置登录密码全局:line console 0:Password 123:login设置用户到特权密码全局:en password 123:en secret 123:no en secret (删除密码)为交换机配IP全局:in vl 1:ip ad 192.168.1.1 255.255.255.0:no sh为交换机配网关全局:ip default-gateway 192.168.1.10恢复交换机出厂值特权:erase startup-config (清空):reload (重启)删除所有VLAN 全局:no vl 1 - 1005创建VLAN全局:vl 2 (用于真机):in vl 2:name test 2 (改名为test 2)特权:vl database (用于虚拟机和真机):vl 2 name test 2添加端口到VL 全局:in ra(多个) f0/1 – 10:sw ac vl 2从VL删除端口全局:in ra(多个)f0/1 – 10:no sw ac vl 2配置中继链路全局:in f0/1:sw mode trunk:no sh (激活端口)在trunk中添加、删除VL全局:in f0/1:sw tr allowed vl remove vl 2(删除) 全局:in f0/1:sw tr allowed vl add vl 2(添加)路由器以上命令是我认为学交换机和路由器必须要掌握的。

先就为大家收集这么多了,希望大家能好好学习。

当中可能会存在错误,如果大家发现请及时通知我。

谢谢~!SIT806——无敌精英班 班长留给路由器接口配IP全局:in f0/1:ip ad 192.168.2.2 255.255.255.0 :no sh配置单臂路由全局:in f0/0.1:encapsulation dot1q 1(VL1) :ip ad 192.168.1.1 255.255.255.0查看路由表特权:sh ip route关闭路由全局:no ip routing添加逻辑端口全局:int loopback 0配置默认路由全局:ip route 0.0.0.0 0.0.0.0 address(下一跳IP)配置静态路由 全局:ip route 192.168.1.0 255.255.255.0 192.168.2.1配置动态路由全局:router rip:network 172.25.0.0(所有直连网段)RIP V2的配置全局:router rip:version 2:no auto-summary (关闭汇总)设置远程管理全局:line vty 0 4(允许0到4,五个用户登录):login:pawwword 123全局:enable password 123。

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

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

华为路由器交换机配置命令大全华为路由器交换机配置大全本文提供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;设置口令模式首先,这篇文章需要进行重新排版和编辑,以便更清晰地传达信息。

华为路由器交换机常用命令

华为路由器交换机常用命令

华为路由器交换机常用命令一、设备管理命令1.登录管理命令- ssh [ip地质] -p [端口号]:通过SSH协议登录设备。

- telnet [ip地质]:通过Telnet协议登录设备。

- logout:退出设备。

2.用户管理命令- display current-configuration:显示当前设备配置信息。

- save:保存当前配置。

- undo save:取消保存的配置。

- super:切换到超级用户模式。

- user-interface console 0:配置控制台终端的参数。

- user-interface vty 0 4:配置远程登录终端的参数。

3.设备操作命令- reboot:重启设备。

- reset saved-configuration:恢复出厂配置。

- display version:显示设备的硬件和软件版本信息。

- display device:显示设备的基本信息。

- display interface[接口名称]:显示指定接口信息。

- display ip routing-table:显示IP路由表信息。

二、网络配置命令1.IP配置命令- interface [接口名称]:进入指定接口。

- ip address [IP地质] [子网掩码]:配置接口IP地质。

- undo ip address:取消接口IP地质配置。

- ip route-static [目标网络] [子网掩码] [下一跳地质]:配置静态路由。

- undo ip route-static [目标网络] [子网掩码] [下一跳地质]:取消静态路由配置。

2.VLAN配置命令- vlan [VLAN ID]:创建指定VLAN。

- quit:退出VLAN配置模式。

- interface vlan [VLAN ID]:进入指定VLAN接口。

- ip address [IP地质] [子网掩码]:为VLAN接口配置IP地质。

最全路由交换配置命令大全

最全路由交换配置命令大全

基础命令练习1.模式Router> //用户模式Router# //特权模式(也叫enable 模式)Router(config-if)# //接口模式Router(config-router)# //router 模式Router(config-line)# //line 模式Router(config-subif)# //子接口模式2.模式切换Router> //用户模式Router>enable //在用户模式敲入enable 进入特权模式(也叫enable 模式)Router#disable //在特权模式敲入disable 退出到用户模式Router>enable //在用户模式敲入enable 进入特权模式Router#configure terminal //在特权模式敲入configure terminal 进入到配置模式Router(config)#interface ethernet 0/0 //在配置模式敲入“interface+接口类型+接口编号”进入接口模式Router(config-if)#exit //敲入exit 退出接口模式Router(config)#router rip //敲入“router + 路由协议”进入router 模式Router(config-router)#exit //退出router 模式Router(config)#line console 0 //进入line 模式Router(config-line)#end //从line 模式退出(任何时候敲入end 会退出到特权模式)Router#conf tRouter(config)#interface ethernet 0/0.1 //进入子接口模式Router(config-subif)#end //任何时候敲入end 会退出到特权模式Router#2.为路由器定义名称router(config)#hostname xxx(xxx 为我们定义的名称)Router(config)#host fxhfxh(config)#定义路由器的名称为FXH,那么对路由器定义名称,是为了区别我们所操作所有设备的不同.3.为路由器添加特权密码router(config)#enable password sss(sss 为我们定义的明文密码)router(config)#enable secret cisco (cisco 为我们定义的密文密码)router(config)#service password-encryption //对口令进行加密,加密console 口或VTY 或是enable password 设置的密码,密码不再显示明文4.不执行DNS 解析router(config)#no ip domain-lookup (这条命令的作用是:当我们在执行命令错误的时候,路由器会认为这条命令没有错误,它只是一个域名的形式,那么他会给你解析,这样,很浪费我们宝贵的时间5.配置路由器,使得控制台端口不会中止你的连接。

交换机和路由器命令

交换机和路由器命令
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,服务质量,用于在网络通信中对不同数据流进行优先级和带宽控制。

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)交换机路由器命令大全(结合配置实例)交换机和路由器是计算机网络中常用的网络设备,用于实现数据包的转发和路由选择。

在实际应用中,我们需要使用命令来配置交换机和路由器的各项参数。

本文将给出交换机和路由器常用命令的大全,并结合实际配置示例进行说明。

一、交换机命令1. 查看交换机基本信息查看交换机型号、固件版本、序列号等基本信息:show version2. 配置交换机端口设置交换机接口的速率、全双工模式等参数:interface interface_namespeed speed_valueduplex {full | half}3. 查看交换机端口状态查看交换机端口的连接状态、速率、工作模式等信息:show interfaces status4. 配置交换机VLAN创建VLAN和端口关联,实现VLAN的隔离和管理:vlan vlan_idname vlan_nameinterface interface_name5. 查看交换机MAC表显示交换机学习到的MAC地址和对应的端口:show mac-address-table6. 配置交换机链路聚合将多个物理端口绑定为一个逻辑端口,提高带宽和冗余性:interface port-channel channel_numberdescription description_textswitchport mode trunk/access7. 交换机Spanning Tree配置配置交换机的Spanning Tree协议参数,避免网络环路:spanning-tree vlan vlan_idpriority priority_value二、路由器命令1. 查看路由表显示路由器的路由表,包括直连路由、静态路由和动态路由表项:show ip route2. 配置静态路由手动配置路由器的静态路由表,指定目的网络和下一跳信息:ip route destination_network subnet_mask next_hop_ip3. 配置路由器接口配置路由器的接口参数,包括IP地址、子网掩码、描述等:interface interface_nameip address ip_address subnet_maskdescription description_text4. 配置路由器OSPF协议配置路由器之间的OSPF动态路由协议,实现网络的动态路由选择:router ospf process_idnetwork network_address wildcard_mask area area_number5. 配置路由器ACL配置路由器的访问控制列表,用于控制数据包的流量:access-list access_list_number permit/deny source destination6. 配置路由器NAT配置路由器的网络地址转换功能,实现内网与外网的互通:interface interface_nameip nat inside/outside三、配置实例1. 配置交换机端口接口GigabitEthernet0/1配置为100Mbps全双工模式:interface GigabitEthernet0/1speed 100duplex full2. 配置交换机VLAN创建VLAN10,将接口GigabitEthernet0/1划分到VLAN10:vlan 10name VLAN10interface GigabitEthernet0/13. 配置路由器接口将接口GigabitEthernet0/0配置为192.168.1.1/24的IP地址:interface GigabitEthernet0/0ip address 192.168.1.1 255.255.255.0description LAN interface4. 配置静态路由配置路由器的静态路由表,将目的网络192.168.2.0/24指向下一跳192.168.1.2:ip route 192.168.2.0 255.255.255.0 192.168.1.25. 配置路由器ACL设置访问控制列表,允许源IP地址为192.168.1.0/24的流量通过:access-list 1 permit 192.168.1.0 0.0.0.2556. 配置路由器NAT设置路由器的NAT,将内部接口GigabitEthernet0/1地址转换为公网地址:interface GigabitEthernet0/1ip nat inside以上是交换机和路由器常用命令的大全以及配置实例。

华三交换机-路由器配置命令

华三交换机-路由器配置命令

华三交换机-路由器配置命令华三交换机-路由器配置命令第一章:登录华三交换机-路由器1. 使用浏览器登录:a. 打开浏览器;b. 在地址栏中输入交换机-路由器的IP地址;c. 输入正确的用户名和密码;d. 单击登录按钮。

2. 使用命令行登录:a. 打开命令提示符或终端窗口;b. 输入telnet或ssh命令,后跟交换机-路由器的IP地址;c. 输入正确的用户名和密码;d. 按下回车键登录。

第二章:基本配置1. 设置主机名:hostname [主机名]2. 设置登录密码:enable password [密码]3. 配置管理接口:interface [接口]ip address [IP地址] [子网掩码] 4. 配置默认网关:ip default-gateway [默认网关]第三章:VLAN(虚拟局域网)配置1. 创建VLAN:vlan [VLAN号]name [VLAN名称]2. 配置端口―VLAN关联:interface [端口]switchport mode accessswitchport access vlan [VLAN号] 3. 配置交换机端口为Trunk口:interface [端口]switchport mode trunk第四章:路由配置1. 静态路由配置:ip route [目标网络] [目标子网掩码] [下一跳IP地址] 2. OSPF(开放最短路径优先)配置:router ospf [进程号]network [网络地址] [通配符] area [区域号]3. BGP(边界网关协议)配置:router bgp [自治系统号]neighbor [对等体IP地址] remote-as [对等体自治系统号]第五章:安全配置1. 配置SSH(安全外壳协议):crypto key generate rsaip ssh server enable2. 配置访问控制列表(ACL):ip access-list [ACL名称]permit/deny [源IP地址] [目标IP地址] [协议]第六章:性能优化配置1. 配置端口速率限制:interface [端口]bandwidth [带宽]2. 配置端口链路聚合(LACP):interface port-channel [聚合组号]channel-group [组号] mode active3. 配置端口流量控制:interface [端口]storm-control [选项]附件:本文档涉及的附件可在[link]。

华为交换机和路由器基本安全登录配置命令

华为交换机和路由器基本安全登录配置命令

一、拿到一台新的华为设备,我们首先要进行本地配置,比如配置密码,开启远程控制,配置用户设置权限等。

系统默认是没有开启telnet远程的,很多配置是需要我们在本地配置中开启的。

下面我们讲解华为设备的安全登录设置。

注:我们使用的是华为ensp模拟器进行讲解。

1.1、不同网络设备的需求和工作模式互不相同,其具体配置方法也会有较大的不同。

但所有的交换机/路由器都有一些共同的部分,可以把这些部分作为基本的模板用于最初的配置。

配置图如下:1、在路由器AR1设置本地登录用户视图(console端口)登录密码<Huawei>system-view //进入系统视图[Huawei]user-interface console 0//进入用户视图[Huawei-ui-console0]authentication-mode password //配置用户视图密码,最长16位Please configure the login password (maximum length 16):wltx //输入密码wltx[Huawei-ui-console0]set authentication password cipher 123 //修改用户视图验证密码,可跟56位密文[Huawei-ui-console0]return //回到用户视图,如前面的是<Huawei>,说明回到了用户视图。

<Huawei>save//保存配置The current configuration will be written to the device.Are you sure to continue? (y/n)[n]:y //按y确认保存<Huawei>quit //退出Configuration console exit please press any key to log onLogin authenticationPassword: //再次登录用户视图需要输入密码此时登录则需要输入密码才能进入用户视图,如果要取消安全认证,则执行以下命令。

交换机和路由器的基本配置命令

交换机和路由器的基本配置命令

使用的是cisco网络设备操作系统命令,其他厂商设备应该相差不远,实验使用的设备时cisco catalyst1912交换机和cisco 2621路由器。

终端的IP配置命令:Ipconfig /ip IP地址子网掩码;Ipconfig /dg 网关IP常用的交换机的配置命令:交换机工作在OSI 模型的第二层(数据链路层), 地址学习, 转发过滤, 消除循环是交换机的三个主要功能。

有三种模式,“>”用户模式,“#”特权模式,“(CONFIG)#”全局模式.从用户模式进入特权模式:enable从特权模式进入全局模式:configure terminal,在特权模式下输入disable或者exit 回到用户模式,其他模式类似。

从全局模式进入端口模式:interface e0/1。

switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态用户模式(>)下:可以查看一些基本的配置信息。

特权模式(#)下:show ip 查看交换机的IP地址。

Show interface 查看所有端口的配置信息show interfaces Ethernet 0/1 查看E0/1口的信息Show interface e0/1 查看e0/1端口的配置信息。

show version 查看系统硬件的配置,软件版本号等。

show port ;(CatOS)显示每个端口的简要信息(号、VLAN、双工、…)show interface ;(IOS)show trunk ;(CatOS)显示中继信息(模式、封装、允许端口、剪裁、…)show interface trunk ;(IOS)show spantree 45 ;(CatOS)显示端口的STP模式、类型、状态、速端口、…) show spanning-tree 45 ;(IOS)Show running-config (show running也可以)查看当前正在运行的配置信息全局模式//配置模式((config)#):设置交换机名:hostname[交换机名]如:hostname switch1设置交换机的IP地址:ip address [ip address ][netmask]如ip address 172.16.0.1 255.255.0.0设置交换机的缺省网关:ip default-gatway [ip address]如:ip default-gatway 172.16.0.1设置密码enable password level [1-15] [passwork]1-15 表示级别,1表示设置登录时的密码,15设置进入全局模式的密码。

路由器与交换机的配置代码

路由器与交换机的配置代码

1.配置路由器的主机名和提示信息。

Router(config)#Router(config)#hostname R1R1(config)#banner motd %Enter TEXT message. End with the character '%'.2.配置enable密码、配置console和vty密码。

R1(config)#enable secret classR1(config)#line console 0R1(config-line)#password ciscoR1(config-line)#loginR1(config-line)#line vty 0 4R1(config-line)#password ciscoR1(config-line)#login3.配置接口(s0/0和f0/0),并显示接口信息。

R1(config)#interface FastEthernet0/0R1(config-if)#ip address 192.168.10.1 255.255.255.0R1(config-if)#no shutdown保存配置R1#copy running-config startup-configDestination filename [startup-config]?Building configuration...[OK]删除启动配置R1#erase startup-configErasing the nvram filesystem will remove all configuration files! Continue? [confirm] [OK]Erase of nvram: complete%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram查看R1的cdp邻居R1#show cdp neighbors关闭R1接口下的cdpR1(config)#interface s0/0/0R1(config-if)#no cdp enable打开R1接口下的cdpR1(config)#interface s0/0/0R1(config-if)#cdp enableble4)关闭和打开整个路由的cdp关闭R1整个路由的cdpR1(config)#no cdp run打开R1整个路由的cdpR1(config)#cdp run关闭R2整个路由的cdpR2(config)#no cdp run打开R2整个路由的cdpR2(config)#cdp run5)在R1和R2上的s0/0上配置IP地址,以及enable密码和vty密码对R1进行配置R1(config)#interface s0/0/0R1(config-if)#ip address 192.168.1.1 255.255.255.0R1(config-if)#no shutdownR1(config)#enable secret classR1(config-line)#line vty 0 4R1(config-line)#password ciscoR1(config-line)#loginWrite)4)把IOS从路由器备份到TFTP服务器上。

路由与交换--ACL基本命令及其实验配置

路由与交换--ACL基本命令及其实验配置

路由与交换--ACL基本命令及其实验配置1 ACL 的配置1.1 创建 ACL标准 ACLrouter(config)#access-list <ACL表号> {permit|deny}{<源IP|host><反掩码>|any} //表号1~99扩展 ACLrouter(config)#access-list <ACL表号> {permit|deny}{<协议名称>|<端⼝号>}{<源IP><反掩码>}{<⽬的IP><反掩码>}{<关系><协议名称>} //表号101~1991.2 应⽤ ACLrouter(config-if)#{协议栈} access-group <ACL表号> {in|out} //协议栈可以为IP或IPX2 ACL 上机实验2.1 ACL 配置举例 1router(config)#access-list 1 deny 10.0.0.10.0.0.0//ACL表号为1,丢弃10.0.0.1发出的数据包,相当于 deny host 10.0.0.1router(config)#access-list 1 permit anyrouter(config)#access-list 2 permit any //ACL表号为2,可以转发任意数据包router(config)#int s0/0router(config-if)#ip access-group 1in//该接⼝输⼊⽅向应⽤ACL列表组1,拒绝来⾃10.0.0.1的数据包router(config-if)#ip access-group 2out//该接⼝输出⽅向应⽤ACL列表组2,允许发出流经该路由器的所有数据包2.2 ACL 配置举例 2router(config)#access-list 101 deny tcp 172.16.0.00.0.255.255 host 192.168.1.1 eq telnet //不允许172.16.0.0⽹络的数据包telnet主机192.168.1.1router(config)#access-list 101 permit ip any any //允许转发其他任何数据包router(config)#int s0/0router(config-if)#ip access-group 101in2.3 ACL 配置举例 3限制只允许 192.168.2.2 访问 192.168.1.2 的 80 端⼝,192.168.3.2 访问 192.168.1.2 的 DNS。

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)一交换机命令switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态switch>enable ;进入特权模式交换机口令设置:switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(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(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息二、路由器命令路由器显示命令: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 ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xxrouter(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address ;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口IProuter(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导静态路由:ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例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路由协议。

交换机路由器常用命令

交换机路由器常用命令

交换机路由器常用命令交换机和路由器是网络中非常重要的设备,熟练掌握它们的常用命令对于网络管理和故障排除至关重要。

下面为您介绍一些交换机和路由器常用的命令。

一、交换机常用命令1、`enable` 命令这个命令用于进入特权模式。

在特权模式下,可以执行更多高级的配置和管理操作。

2、`configure terminal` 命令输入此命令后,可以进入全局配置模式,对交换机的整体参数进行设置。

3、`interface` 命令通过`interface` 加上接口类型和编号,例如`interface ethernet0/1` ,可以进入特定接口的配置模式,对该接口的参数进行详细配置。

4、`vlan` 命令`vlan` 相关的命令用于创建、删除和配置 VLAN(虚拟局域网)。

比如`vlan 10` 创建 VLAN 10 ,`name VLAN10` 为 VLAN 10 命名。

5、`show vlan` 命令用于查看交换机上已创建的VLAN 信息,包括VLAN 编号、名称、端口成员等。

6、`show interfaces` 命令此命令可以查看交换机各个接口的状态、速率、双工模式等详细信息。

7、`port trunk allowpass vlan` 命令在配置 trunk 链路时,使用该命令允许特定的 VLAN 通过 trunk 链路。

8、`spanningtree` 命令用于配置生成树协议,防止网络环路。

例如`spanningtree moderstp` 可以设置生成树的模式为快速生成树。

二、路由器常用命令1、`enable` 命令同样用于进入特权模式。

2、`configure terminal` 命令进入全局配置模式。

3、`interface` 命令例如`interface fastethernet 0/0` ,进入特定的接口配置模式。

4、`ip address` 命令为接口配置 IP 地址,如`ip address 19216811 2552552550` 。

路由器和交换机命令大全

路由器和交换机命令大全

路由器和交换机命令大全路由器和交换机是计算机网络中常用的设备,它们在数据传输和网络管理中发挥着重要的作用。

掌握路由器和交换机的命令是网络管理和故障排除的基本要求。

本文将为您提供常见的路由器和交换机命令大全,以帮助您更好地理解和应用这些设备。

一、路由器命令1. show ip route:显示路由表中的所有路由信息。

2. show interfaces:显示接口的状态和统计信息。

3. show running-config:显示当前路由器的配置信息。

4. show version:显示路由器的硬件和软件版本信息。

5. configure terminal:进入全局配置模式。

6. interface interface-name:进入指定接口的配置模式。

7. ip address ip-address subnet-mask:为接口配置IP地址和子网掩码。

8. ip route destination-network subnet-mask next-hop:配置静态路由。

9. access-list access-list-number {deny | permit} source destination:配置访问控制列表。

10. clear arp-cache:清除路由器的ARP缓存。

11. debug {protocols | ip | interface}:启用某个调试功能来监控网络流量或接口状态。

二、交换机命令1. show interfaces:显示接口的状态和统计信息。

2. show mac-address-table:显示交换机的MAC地址表。

3. show running-config:显示当前交换机的配置信息。

4. show vlan:显示交换机的VLAN信息。

5. configure terminal:进入全局配置模式。

6. interface interface-name:进入指定接口的配置模式。

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

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

华为路由器、交换机配置命令大全华为路由器配置命令大全:一、登录华为路由器控制台1:使用PuTTY或其他SSH客户端登录到华为路由器:```ssh admin<路由器IP地址>```2:输入登录密码进行验证。

二、基本配置命令1:设置主机名:```sysname <主机名>```2:配置管理接口:```interface GigabitEthernet0/0/0ip address <IP地址> <子网掩码>```3:配置VLAN接口:```interface Vlanif <VLAN ID>ip address <IP地址> <子网掩码>```三、路由相关配置命令1:静态路由配置:```ip route-static <目标网络> <子网掩码> <下一跳地址> ```2:动态路由配置:```router ospf <进程ID>router-id <路由器ID>network <网络地址> <子网掩码> area <区域ID>3: BGP路由配置:```bgp <AS号码>router-id <路由器ID>peer <对端IP地址> as-number <对端AS号码>```四、安全配置命令1:配置防火墙规则:```acl number <ACL编号>rule <规则序号> permit source <源地址> destination <目的地址>rule <规则序号> deny source <源地址> destination <目的地址>```2:开启SSH服务:ssh server enable```3:配置AAA认证:```aaalocal-user <用户名> password irreversible-cipher <加密密码>authorization-attribute user-role network-admin```五、NAT配置命令1:配置静态NAT:```interface GigabitEthernet0/0/0nat outbound <内部接口> <外部接口>```2:配置动态NAT:nat address-group <地址组名>address <内部地址> <外部地址>```3:配置PAT:```interface GigabitEthernet0/0/0nat address-group <地址组名>```附件:1:示例配置文件(附件1)2:路由器接口图(附件2)法律名词及注释:1:主机名:路由器的标识名称。

路由器和交换机的配置命令的简写

路由器和交换机的配置命令的简写

那可多了~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 [list ACL-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)# ^zywELinux联盟配置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)# ^zywELinux联盟PAP双向认证配置实例:路由器 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 12345 routerB(config-if)# ^zCHAP单向认证配置实例:验证方:router-server(config)# username router-client password 12345 router-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-client router-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)# ^zywELinux联盟Telnet使用: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)# ^zywELinux联盟设置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]:ywELinux联盟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交换机命令详解

思科的路由器配置及H3C交换机命令详解

思科的路由器配置及H3C交换机命令详解思科路由器配置在网络设备中,路由器是一个重要的组件,用于将数据包从一个网络传输到另一个网络。

思科公司是一个广泛使用的路由器制造商,下面将详细介绍思科路由器的配置。

一、连接到路由器1. 打开终端程序,输入路由器的IP地址。

例如:192.168.1.12. 输入用户名和密码以登录路由器的管理界面。

默认情况下,用户名为"admin",密码为空。

3. 成功登录后,将进入路由器的配置界面。

二、基本配置1. 设置路由器的主机名。

使用以下命令:hostname 路由器名称2. 配置路由器的IP地址和子网掩码。

使用以下命令:interface GigabitEthernet0/0ip address 192.168.1.1 255.255.255.0这里的“GigabitEthernet0/0”是代表路由器的接口名称,具体根据路由器型号和配置来定。

三、路由配置1. 配置静态路由。

使用以下命令:ip route 目标网络子网掩码下一跳IP地址例如,要将数据包发送到目标网络192.168.2.0/24,下一跳IP地址为192.168.1.2:ip route 192.168.2.0 255.255.255.0 192.168.1.22. 配置动态路由。

使用以下命令:router ospf 进程号network 目标网络区域号例如,将192.168.1.0/24和192.168.2.0/24添加到OSPF进程号为1的区域0:router ospf 1network 192.168.1.0 0.0.0.255 area 0network 192.168.2.0 0.0.0.255 area 0H3C交换机命令详解H3C交换机是一种高级网络设备,用于在局域网中转发数据包。

下面将详细介绍H3C交换机的配置命令。

一、连接到交换机1. 打开终端程序,使用Console或SSH连接到交换机。

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

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-config
startup-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 flash
3、在特权模式下输入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)#login
5、配置远程登录的密码:
①、首先要配置使能密码
②、允许让几个人登录:switch(config)#line vty 0 4(即允许五个登录)
③、设置密码:switch(config-line)#password + 密码
④、允许远程登录:switchp(config-line)#login
6、在全局模式下的有关命令
①对所有密码进行加密:switch(config)#service password-encryption
②、不解析错误的命令:switch(config)#no ip domain-lookup
7、创建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信息就要打中继口,即trunk
a、switch(config)#interface + 交换机另一端口
b、switch(config-if)#switchport mode trunk
8、传统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的IP
9、三层交换
(1)、配置三层交换
①、启用三层交换:(config)#ip routing
②、创建vlan:(config)# vlan + 要创建vlan的值
③、把相应的vlan配置IP
a、指定一个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里面共有什么端口,寄存器的值等等。

2、show protocol 显示与IP有关的路由协议信息,各个端口的情况。

3、show Flash 查看Flash中的内容,IOS的长度,文件名,剩余空间、总共空间。

4、show running-config 查看路由器当前的配置信息。

5、show startup-config 查看nvram中的路由器配置信息。

6、show interface 查看路由器上的各个端口的状态信息。

7、show controller 查看接口控制器的状态,可看到连接的是DTE还是DCE。

8、show history 查看history buffer里面的命令列表。

9、terminal history size<size> 设置history buffer里面保存命令的个数。

最大允许值为26.
保存、删除、查看配置文件
1、保存配置文件 copy running-config startup-config
2、删除配置文件 erase nvram或erase startup-config
静态路由协议:a、距离矢量;b、管理员和配置。

相关文档
最新文档