路由器常用命令

配置路由器 配置路由器密码: (1)配置Console端口密码: R1(config)# line console 0 R1(config-line)# password cisco R1(config-line)# login (2)配置从用户模式切换到特权模式的使能密码: R1(config)# enable password cisco R1(config)# enable secret cisco123 (另外可以配置秘密使能密码) (3)配置远程登录密码(VTY,虚拟终端类型)默认不允许远程访问 R1(config)#line vty 0 4 R1(config-line)#password cisco R1(config-line)#login

配置路由器接口IP:

R1(config)# interface s1/1
R1(config-if)# ip address 12.1.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

配置路由器接口secondary地址:

R1(config)# interface s1/1
R1(config-if)# ip address 12.1.1.1 255.255.255.0
R1(config-if)# ip address 13.1.1.1 255.255.255.0 secondary
R1(config-if)# no shutdown
R1(config-if)# exit

取消接口的多个IP地址:

R1(config-if)# no ip address [ip] [子网掩码]

删除接口下的所有IP:

R1(config-if)# no ip address

配置主机名列表:

R1(config)#ip host abc 12.1.1.2 (配置完后远程登录可以用telnet abc代替主机IP)

查看路由器上配置的主机名列表:

配置DNS服务器:

配置静态路由 R1(config)#ip route 目标网络 掩码 下一跳路由器直连接口的IP或本路由器外出接口 管理距离 [permanent] 使用permanent参数,不管发生什么意外情况,该静态路由不会从路由表消失。 前面加no删除该静态路由。

默认路由:用来转发不在路由列表中列出的远端目的网络的数据包 R1(config)#ip route 0.0.0.0 0.0.0.0 下一跳路由地址

动态路由 1. RIPv1协议配置

配置默认路由(默认网关):

负载均衡:

关闭快速交换使用进程交换:

禁用水平分割:

  1. RIPv2协议配置

  2. OSPF协议配置

使用路由器模拟PC

Last updated

Was this helpful?