路由器的配置命令
1. 在全局配置模式下输入"hostname + 要改的名字"。
2.在线路模式下输入"logging synchronous"
3.设备加密:此加密是对刚进入路由器时加密
注:在IOS系统中输入密码时屏幕不显示密码
4.在全局配置模式下输入"username + 用户名 password(secret密文加密) + 密码"并在线路模式下输入"login local"
5.在全局配置模式下输入"username 用户名 privilege 等级数 password 密码"
6.在全局配置模式下输入"enable secret 密码"
7.特权模式下输入"copy running-config startup-config"
8.在接口模式下给路由器配置Ip地址。输入:IP address 地址 子网掩码,输入IP地址后需要输入"no shutdown"来打开接口。
9.在特权模式下输入:show ip interface brief
10.DHCP动态主机配置协议
2023-07-25 广告
1、R1上配置接口IP:
> R1(config)#interface fastEthernet 0/0 R1(config-if)#ip address 192.168.1.254 255.255.255.0
> R1(config-if)#no shutdown
> R1(config-if)#exit
> R1(config)#interface fastEthernet 0/1
> R1(config-if)#ip address 192.168.2.1 255.255.255.0
> R1(config-if)#no shutdown
2、R2上配置接口IP
> R2(config)#interface fastEthernet 0/1 R2(config-if)#ip address192.168.2.2 255.255.255.0
> R2(config-if)#no shutdown
> R2config-if)#exit
> R2(config)#interface fastEthernet 0/0 R2(config-if)#ip addres 192.168.3.254 255.255.255.0
> R2(config-if)#no shutdown
3、R1上添加静态路由
> R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2
4、R1上查看路由表
> R1#show ip route Codes:
> C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
> E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
> i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
> * - candidate default, U - per-user static route, o - ODR
> P - periodic downloaded static route Gateway of last resort is not set
> C 192.168.1.0/24 is directly connected, FastEthernet0/0
> C 192.168.2.0/24 is directly connected, FastEthernet0/1
> S 192.168.3.0/24 [1/0] via 192.168.2.2 //S表示静态路由
5、R2上添加静态路由
> R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
6、R2上查看路由条目
> R2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP,
> M - mobile, B - BGP
> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
> E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
> i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
> * - candidate default, U - per-user static route, o - ODR
> P - periodic downloaded static route Gateway of last resort is not set
S 192.168.1.0/24 [1/0] via 192.168.2.1 //S表示静态路由
C 192.168.2.0/24 is directly connected, FastEthernet0/1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
扩展资料:
拓扑网络验证:
测试网络连通性,PC1 ping 192.168.3.1
> PC>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time=1ms TTL=126
Reply from 192.168.3.1:bytes=32 time=11ms TTL=126
Reply from 192.168.3.1: bytes=32 time=10msTTL=126
Reply from 192.168.3.1: bytes=32 time=11ms TTL=126
> Ping statistics for 192.168.3.1:
> Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
> Approximate round trip times in milli-seconds:
> Minimum = 1ms, Maximum = 11ms, Average = 8ms
参考资料来源:百度百科--静态路由