路由器的配置命令总结

合集下载

路由器配置命令大全

路由器配置命令大全

路由器配置命令大全路由器配置命令大全1.连接路由器1.1 使用串行控制台线连接路由器1.2 使用以太网接口连接路由器1.3 使用无线网络连接路由器2.基本配置2.1 配置主机名router(config)hostname [hostname]2.2 配置域名解析router(config)ip domn-name [domn-name] 2.3 配置密码router(config)enable secret [password] router(config)line console 0router(config-line)password [password] router(config-line)loginrouter(config-line)exitrouter(config)line vty 0 15router(config-line)password [password]router(config-line)loginrouter(config-line)exit2.4 配置管理IP地质router(config)interface [interface]router(config-if)ip address [ip-address] [subnet-mask]router(config-if)no shutdown3.网络协议配置3.1 配置静态路由router(config)ip route [destination-network] [subnet-mask] [next-hop]3.2 配置动态路由router(config)router [routing-protocol]router(config-router)network [network-address] [subnet-mask]3.3 配置带宽管理router(config)interface [interface]router(config-if)bandwidth [bandwidth-in-kbps]3.4 配置ACL(访问控制列表)router(config)access-list [access-list-number] [permit/deny] [source-network] [source-wildcard]4.NAT(网络地质转换)配置4.1 配置静态NATrouter(config)ip nat inside source static [inside-local-address] [outside-global-address]4.2 配置动态NATrouter(config)ip nat pool [pool-name] [start-ip-address] [end-ip-address] netmask [subnet-mask]router(config)ip nat inside source list [access-list] pool [pool-name]4.3 配置PAT(端口地质转换)router(config)interface [interface]router(config-if)ip nat insiderouter(config)interface [interface]router(config-if)ip nat outside5.VLAN(虚拟局域网)配置5.1 配置VLANrouter(config)vlan [vlan-id]router(config-vlan)name [vlan-name]5.2 配置接口VLANrouter(config)interface [interface]router(config-if)switchport mode accessrouter(config-if)switchport access vlan [vlan-id]5.3 配置Trunk接口router(config)interface [interface]router(config-if)switchport mode trunkrouter(config-if)switchport trunk allowed vlan [vlan-list]6.特定协议配置6.1 配置DHCP(动态主机配置协议)router(config)ip dhcp pool [pool-name]router(dhcp-config)network [network-address] [subnet-mask]router(dhcp-config)default-router [default-gateway]router(dhcp-config)dns-server [dns-server-ip]6.2 配置NTP(网络时间协议)router(config)ntp server [ntp-server-ip]router(config)ntp update-calendar6.3 配置SNMP(简单网络管理协议)router(config)snmp-server community [community-string] [ro/rw]router(config)snmp-server host [host-ip] [community-string]7.安全配置7.1 配置SSH(安全外壳协议)router(config)hostname [hostname]router(config)ip domn-name [domn-name]router(config)crypto key generate rsarouter(config)ip ssh version 2router(config)line vty 0 15router(config-line)transport input sshrouter(config-line)login localrouter(config-line)exit7.2 配置防火墙router(config)access-list [access-list-number] [permit/deny] [source-network] [source-wildcard] router(config)interface [interface]router(config-if)ip access-group [access-list-number] [in/out]附件:无法律名词及注释:- IP地质:Internet Protocol Address,互联网协议地质,用于标识网络上主机的唯一数字标识。

路由器的路由配置命令汇总(win和linux系统)

路由器的路由配置命令汇总(win和linux系统)

路由器的路由配置命令汇总(win和linux系统)2009-07-16 17:43:15分类:系统运维⼯作时总是要在这三个个体中配来配去,所以为了⽅便,汇总了。

win下:使⽤ Route 命令⾏⼯具查看并编辑计算机的 IP 路由表。

Route 命令和语法如下所⽰:route [-f] [-p] [Command][Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]-f 清除所有⽹关⼊⼝的路由表。

如果该参数与某个命令组合使⽤,路由表将在运⾏命令前清除。

-p 与 add 命令⼀起使⽤时使路由具有永久性。

该参数与 add 命令⼀起使⽤时,将使路由在系统引导程序之间持久存在。

默认情况下,系统重新启动时不保留路由。

与 print 命令⼀起使⽤时,显⽰已注册的持久路由列表。

忽略其他所有总是影响相应持久路由的命令。

Command 指定您想运⾏的命令 (Add/Change/Delete/Print)。

路由类型:有三种路由1.主机路由从⼀台主机映射⼀条到本地⽹络上的的其他主机上command format:route add -host destination_ip local_ip -interface interfaceeg:我们想为本地主机接⼝hme0(204.12.17.1)和另⼀台在相邻才C类⽹络上的主机(204.12.16.100)之间增加⼀条路由#route add -host 204.12.16.100 204.12.17.1 -interface hme02.⽹络路由允许数据包从本地主机传输到在本地⽹络的其他主机上增加⼀个到另⼀个⽹络的的直接路由command format:route add -net destination_network_ip local_ip -netmask maskeg:如果我们要想为C类⽹掩码在本地主机(204.12.17.1)和我们上⾯指出的⽹络之间增加⼀条路由(204.12.16.0⽹络)我们可以使⽤如下的命令:#route add -net 204.12.16.0 204.12.17.1 -netmask 255.255.255.03.缺省路由将寻找⼀条路由的任务传送到⼀台路由器。

路由器配置命令大全

路由器配置命令大全

路由器配置命令大全视图模式介绍:普通视图router>特权视图router# /在普通模式下输入enable全局视图router(config)# /在特权模式下输入config t接口视图router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0路由协议视图router(config-route)# /在全局模式下输入router 动态路由协议名称1、基本配置:router>enable /进入特权模式router#conf t /进入全局配置模式router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字router(config)#enable password /设置特权口令router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式router(config-line)#password xxx /设置telnet的密码router(config-line)#login /使能可以登陆router(config)#line con 0 /进入控制口的服务模式router(config-line)#password xxx /要设置console的密码router(config-line)#login /使能可以登陆2、接口配置:router(config)#int s0 /进入接口配置模式serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口)router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议hdlc 或者ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca frrouter(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口3、路由配置:(1)静态路由router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 下一条或自己的接口router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由(2)动态路由rip协议router(config)#router rip /启动rip协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#version 2 转换为rip 2版本router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用router(config-router)# passive-int 接口名/启动本路由器的那个接口为被动接口router(config-router)# nei xxx.xxx.xxx.xxx /广播转单播报文,指定邻居的接ip,igrp协议-----内部网关路由协议(IGRP:Interior Gateway Routing Protocol)router(config)#router igrp xxx /启动igrp协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡eigrp---Enhanced Interior Gateway Routing Protocol(增强网关内部路由线路协议)router(config)#router eigrp xxx /启动协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡router(config-router)#no auto-summary /关闭自动汇总功能ospf协议----开放最短路径协议(OSPF)协议router(config)#router ospf xxx /启动协议启动一个OSPF协议进程router(config-router)#network xxx.xxx.xxx.xxx area xxx /宣告自己的接口或网段在ospf的区域中,可以把不同接口宣告在不同区域中router(config-router)#router-id xxx.xxx.xxx.xxx /配置路由的idrouter(config-router)#area xxx stub /配置xxx区域为末梢区域,加入这个区域的路由器全部要配置这个条命令router(config-router)#area xxx stub no-summary /配置xxx区域为完全末梢区域,只在ABR上配置router(config-router)#area xxx nssa /配置xxx区域为非纯末梢区域,加入这个区域的路由器全部要配置这个条命令router(config-router)#area xxx nssa no-summary /配置xxx区域为完全非纯末梢区域,只在ABR上配置,并发布缺省路由信息进入这个区域内的路由器4、保存当前修改/运行的配置:router#write /将RAM中的当前配置存储到NVRAM中,下次路由器启动就是执行保存的配置router#Copy running-config startup-config /命令与write效果一样5、一般的常用命令router(config-if)#exitrouter(config)#router(config-router)#exitrouter(config)#router(config-line)#exitrouter(config)#router(config)#exitrouter#exit命令/从接口、协议、line等视图模式下退回到全局配置模式,或从全局配置模式退回到特权模式router(config-if)#endrouter(config-router)#endrouter(config-line)#endrouter#end命令/从任何视图直接回到特权模式router#Logout /退出当前路由器登陆模式相对与windows的注销router#reload /重新启动路由器(热启动)冷启动就是关闭路由器再打开电源开关特权模式下:router#show ip route /查看当前的路由表router#clear ip route * /清楚当前的路由表router#show ip protocol /查看当前路由器运行的动态路由协议情况router#show ip int brief /查看当前的路由器的接口ip地址启用情况router#show running-config /查看当前运行配置router#show startup-config /查看启动配置router#debug ip pack /打开ip报文的调试router#terminal monitor /输出到终端上显示调试信息router#show ip eigrp neighbors /查看eigrp协议的邻居表router#show ip eigrp top //查看eigrp协议的拓朴表router#show ip eigrp interface /查看当前路由器运行eigrp协议的接口情况router#show ip ospf neighbor /查看当前路由器的ospf协议的邻居表router#show ip ospf interface /查看当前路由器运行ospf协议的接口情况router#clear ip ospf process /清楚当前路由器ospf协议的进程router#Show interfaces /显示设置在路由器和访问服务器上所有接口的统计信息. 显示路由器上配置的所有接口的状态router#Show interfaces serial /显示关于一个串口的信息router#Show ip interface /列出一个接口的IP信息和状态的小结, 列出接口的状态和全局参数。

路由器配置命令(最全)

路由器配置命令(最全)

路由器的配置命令Router> (用户模式)Router>enable (进入特权模式)Router# (特权模式)Router#configure terminal (进入全局配置模式)Router(config)# (全局配置模式)Router(config)#hostname XXX (设置路由器主机名)Router(config)#enable password 123 (设置特权非密口令)Router(config)#enable secret 123 (设置特权加密口令)Router(config)#interface f0/6 (进入端口配置模式)Router(config-if)# (端口配置模式)Router(config)#line consode 0 (进入控制台端口)Router(config)#line vty 0 4 (进入虚拟终端配置模式)Router(config- line)# (虚拟终端配置模式)Router(config)#router rip (进入rip路由协议配置模式)Router(config-router) ( rip路由协议配置模式)Router(config-router)network 159.105.0.0 (设置参与RIP协议的网络地址,不支持可变长掩码,只有IP网络号)Router(config)#router ospf 63 (进入ospf路由协议配置模式)Router(config-router) # ( ospf路由协议配置模式)Router#write memory (保存配置到路由器的NVRAM中)Router#write network tftp (保存配置到TFTP服务器中)Router#write erase (删除路由配置)设置模式(setup) 刚出厂第一次建立配置文件RXBOOT模式密码丢失,进入可以恢复密码exit逐级退出end 或ctrl+z 直接退至特权模式基本命令:telnet ping trace showtelnet 可以由一台路由器登录到另一台路由器,最多支持5个连接。

路由器的配置命令

路由器的配置命令

路由器的配置命令1.路由器的模式Router>用户模式Router#特权模式Router(config)#配置模式Router(config-if)# 接口模式Router(config)#interface f0/0.1 进入子接口Router(config-subif)# 子接口模式Router(config-line)# 进行线模式Router(config-router)# 路由配置模式2.配置静态路由条目Router(config)# ip route 192.168.10.0 255.255.255.0 192.168.9.2 /192.168.10.0网段及掩码需要经过相邻路由器接口的IP地址3.配置默认路由Router B(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2 /所以外出的数据包如果找不到路由表目均找192.168.2.2接口。

4.配置路由控制台密码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 / 对所有密码加密5.配置控制台会话时间teacher(config)#line console 0teacher(config-line)exec-timeout 0 06.配置控制台输出日志同步teacher(config)#line console 0teacher(config-line)#logging synchronous7.路由密码恢复(1)进入ROM Monitor 模式(2)修改配置寄存器的值,启动是绕过 startup-config文件rommon1>confreg ox2140rommon2>reset(3)用startup-config覆盖running-configROuter#copy starup-config running-config修改密码Router(config)#enable password cisco(4)修改配置寄存器的值Router(config)#config-register ox21028.动态路由配置(1)截断超时(2)打开接口(3)为接口设置IP 地址Router(config)#interface f0/0Router(config-if)#ip address 192.168.1.1Router(configif)#no shutdown(4)启动RIP进程,并宣告主网络号Router(config)#router ripRouter(config-router)#network 192.68.1.09.单臂路由配置Router(config)#interface f0/0.1router(config-subif)#encapsolution dotlq 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 dotlq 2 子网接口封装do1q针对的是VLAN2 Router(config-subif)# 192.168.2.1 255.255.255.0 :设置VLAN2的网关地址路由器的操作系统,它是一个功能非常强大的系统,特别是在一些高档的路由器中,它具有相当丰富的操作命令,就像我们的DOS系统一样。

路由器的配置命令

路由器的配置命令

路由器的配置命令路由器的配置命令可以通过命令行界面(CLI)或者图形用户界面(GUI)来完成。

在命令行界面下,我们可以使用不同的命令,来对路由器进行配置和管理。

一、基本配置命令1. 进入特权模式在配置路由器之前,我们需要进入特权模式。

在命令行界面中输入以下命令,然后按下回车键即可:```enable```2. 进入全局配置模式进入特权模式之后,我们需要进入全局配置模式。

在全局配置模式下,可以对路由器进行各种配置。

在命令行界面中输入以下命令,按下回车键即可:```configure terminal```3. 配置主机名在全局配置模式下,我们可以为路由器配置一个唯一的主机名,以区分其他路由器。

在命令行界面中输入以下命令,按下回车键即可:```hostname Router1```这里的"Router1"可以替换为你想要的主机名。

4. 配置密码为了保护路由器的安全,我们可以为路由器配置密码。

以下是两种常用的密码配置命令:为特权模式设置密码:```enable secret password```为虚拟终端线路设置密码:```line vty 0 4password passwordlogin```这里的"password"可以替换为你想要的密码。

二、接口配置命令1. 进入接口配置模式在全局配置模式下,我们可以进入接口配置模式,对特定接口进行配置。

以下是两个常用的进入接口模式的命令:进入以太网接口配置模式:```interface Ethernet0/0```进入串口接口配置模式:```interface Serial0/0```2. 配置IP地址在接口配置模式下,我们可以为接口配置IP地址。

以下是一个配置IP地址的命令示例:```ip address 192.168.0.1 255.255.255.0```这里的"192.168.0.1"和"255.255.255.0"可以替换为你想要的IP地址和子网掩码。

简述查看路由配置的几种命令

简述查看路由配置的几种命令

查看路由配置的几种命令在计算机网络中,路由配置是非常重要的一项技能。

路由配置是指将数据包从源地址传输到目标地址的过程。

了解并熟练掌握各种路由配置命令是网络工程师的必备技能。

本文将介绍几种常用的查看路由配置的命令,以便更好地理解网络结构和配置。

1. ping 命令ping 命令是网络诊断中最常用的命令之一。

它可以测试数据包从一台计算机传输到另一台计算机的延迟和丢包率。

在查看路由配置时,可以使用 ping 命令来测试不同网络之间的连通性。

例如,可以使用 ping 命令测试从本地计算机到远程服务器的连通性。

2. traceroute 命令traceroute 命令可以显示数据包从一台计算机传输到另一台计算机所经历的所有中间路由器。

在查看路由配置时,可以使用traceroute 命令来了解数据包在网络中的传输路径。

3. route 命令route 命令是网络管理员最常用的命令之一。

它可以显示当前计算机的路由表,并允许管理员配置网络地址和路由。

在查看路由配置时,可以使用 route 命令来查看当前的路由配置,并根据实际情况进行修改。

4. ifconfig 命令ifconfig 命令是 Linux 系统下常用的网络配置命令。

它可以显示计算机的网络配置信息,包括网络接口、IP 地址、子网掩码、广播地址等。

在查看路由配置时,可以使用 ifconfig 命令来查看计算机的网络配置信息,以便更好地了解网络结构。

5. command -p optioncommand -p option 是 Windows 系统下查看路由配置的命令。

它允许管理员查看 Windows 系统下的路由配置信息,并允许管理员进行配置。

在查看路由配置时,可以使用 command -p option 命令来查看 Windows 系统的路由配置信息,并根据实际情况进行修改。

以上是几种常用的查看路由配置的命令。

网络管理员可以使用这些命令来了解网络结构和配置,以便更好地管理和优化网络性能。

路由器基本配置命令

路由器基本配置命令

路由器基本配置命令在网络通信中,路由器被广泛应用于连接不同的子网或网络,实现互联网的数据传输。

要使路由器正常工作,需要进行基本的配置。

本文将介绍一些常用的路由器基本配置命令,帮助读者快速了解和掌握路由器的配置过程。

一、登录路由器首先,我们需要登录路由器的管理界面,以便进行配置。

通常情况下,路由器的默认IP地址为192.168.1.1或192.168.0.1,读者可以根据自己的路由器型号来确认默认IP地址。

在浏览器的地址栏中输入路由器的IP地址,然后按下Enter键,会跳转到登录界面。

输入正确的用户名和密码,即可成功登录路由器。

二、配置路由器接口登录成功后,我们需要配置路由器的接口。

接口是路由器与其他网络设备连接的通道,通过配置接口,路由器才能正常传输数据。

以下是一些常用的配置命令:1. 接口查看命令```bashshow interfaces```该命令可以查看路由器上所有的接口信息,包括接口名称、状态、IP地址等。

通过查看接口信息,可以确认哪些接口是可用的,以及它们的IP地址等信息。

2. 配置接口IP地址命令```bashinterface fa0/0 # 进入接口配置模式ip address 192.168.1.1 255.255.255.0 # 配置接口IP地址及子网掩码no shutdown # 启用接口```以上命令将路由器的fa0/0接口配置为IP地址为192.168.1.1,子网掩码为255.255.255.0的接口,并启用该接口。

3. 配置默认网关命令```baship default-gateway 192.168.1.254```默认网关是路由器与其他网络设备进行通信的出口,需要将默认网关配置为正确的IP地址,使得数据能够正确地传输到其他网络设备。

三、配置路由接口配置完成后,我们需要配置路由,以指定数据包的转发路径。

以下是一些常用的配置命令:1. 配置静态路由命令```baship route 192.168.2.0 255.255.255.0 192.168.1.2```以上命令将192.168.2.0/24网段的数据包通过192.168.1.2这个地址进行转发。

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

路由器的配置命令总结
配置路由器的命令可以分为以下几类:
1. 基础配置命令:
- configure terminal:进入全局配置模式
- hostname:设置路由器的主机名
- enable password:设置特权模式密码
- line console 0:进入控制台线路配置模式
- line vty 0 4:进入虚拟终端线路配置模式
2. 接口配置命令:
- interface interface_name:进入接口配置模式
- ip address:配置接口IP地址
- no shutdown:激活接口
- description:为接口添加描述信息
3. 路由配置命令:
- ip route destination_network next_hop:配置静态路由
- router rip:进入RIP路由器配置模式
- network:指定RIP协议工作的网络地址
4. 网络地址转换(NAT)配置命令:
- ip nat inside source static inside_local_ip outside_global_ip:配置静态NAT
- ip nat pool pool_name start_ip end_ip netmask:配置动态NAT 池
5. 访问控制列表(ACL)配置命令:
- access-list acl_number {deny | permit} source destination:创建ACL规则
- interface interface_name:进入接口配置模式
- ip access-group acl_number {in | out}:应用ACL到接口
6. VLAN配置命令:
- vlan vlan_id:创建VLAN
- switchport mode {access | trunk}:配置接口模式
7. 安全配置命令:
- enable secret:设置特权模式加密密码
- username username password password:创建本地用户
8. 特定协议配置命令:
- router ospf process_ID:进入OSPF路由器配置模式
- network network_address wildcard_mask area area_number:配置OSPF网络
- router bgp autonomous_system_number:进入BGP路由器配置模式
- neighbor ip_address remote-as autonomous_system_number:配置BGP邻居
以上是一些常见的路由器配置命令,不同型号和品牌的路由器可能会有一些差异,具体命令请参考相应的操作手册或文档。

相关文档
最新文档