注意配置RIP协议时最好先将主机和路由器的IP地址配好,线连好,检查一下主机是不是能ping路由器。
F0不能拿来连console线。
ping不到路由器的时候检查一下主机是不是没设置
IP路由器的ip地址不能配错。
路由器之间也可以互相ping
路由器命名:hostname
密码设置:(内容来自优快云)
设置console密码
enable
#configure terminal
(confing)#line console 0
(config-line)#password cisco
(config-line)#login
exit
设置全局密码
enable
#configure terminal
(config)#enable secret cisco(这里cisco是密码)
(config)#login
exit
设置特权密码
Router(config)#line vty 0 4//这里的4写成15以内的整数都行
Router(config-line)#password cisco
Router(config-line)#login
完整密码的配置(路由器和交换机均相同):
Switch>enable
Switch#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#no ip domain-lookup//当输入错误命令时不进行搜索
Switch(config)#service password-encryption//对密码进行加密,否则密码是明文密码
Switch(config)#enable secret class
Switch(config)#banner motd # Unauthorized access is strictly prohibited. #//似乎用于初始化,但是没有查到确切解释。
Switch(config)#line con 0
Switch(config-line)#password ciso
Switch(config-line)#login
Switch(config-line)#logging synchronous//日志同步
Switch(config-line)#line vty 0 15
Switch(config-line)#password ciso
Switch(config-line)#login
Switch(config-line)#exit
路由器基础配置命令
R1:Router>enable #进入特权模式
Router#configure terminal #进入配置模式
Router(config)#interface 接口名字 #进入接口
Router(config-if)#ip address 192.168.10.1 255.255.255.0 #给这个接口配置IP地址和子网掩码
Router(config-if)#no shutdown #打开这个接口(必须)
no ip domain-lookup (可选)当你敲入一个不能识别的命令时,它不会去向查找域名一样,去搜DNS服务器,节省时间。
copy running-config startup-config:保存设置//exit不保存配置一断电就没了
添加一个静态路径:
静态路由的配置:
添加静态路径。
ip route 192.168.0.0 255.255.255.0 s0/0/0
或
ip route 192.168.0.0 255.255.255.0 10.1.1.2 注意这里的10.1.1.2并不在这一个路由器中,这是下一跳的地址
删除静态路径和配置静态路径时的语法差不多,不过需要加一个no
no ip route 192.168.0.0 255.255.255.0 s0/0/0
几个可能有用的检查设置:
ipconfig:显示电脑的ip
show running-config:显示正在运行的配置。
show ip interface brief
show ip protocols 查看ip路由协议配置和统计信息
动态配置:
ip routing //开启三层交换机路由模式
router rip //开始RIP协议进程
version 2 //声明RIPv2协议
passive-interface G0/1//就是让G0/1口只接受更新消息,不发送更新消息。
network 172.30.0.0//命令用来对指定网段接口使能RIP路由,后面的网端只能是自然网段
network 10.0.0.0
no network 10.0.0.0//写错时用这个删除
Router(config-if)# clock rate 64000 //在DCE端设置时钟,注意只在DCE端设
自然网段:ABC类网络的网络号【1-127】【128~191】【192~223】【224~239】
设置默认路由:
R1(config)# ip route 0.0.0.0 0.0.0.0 s0/0/1