cisco路由的配置

RIP

The Routing Information Protocol(RIP)is one of the oldest and simplest dynamic routing protocols used in computer networks.
RIP is classified as an interior gateway protocol (IGP) and is responsible for exchanging routing information
between routers within a network.

配置完PC和Router的IP之后,还是不能进行跨网段通信的,需要配置路由协议

# 启用rip
router rip
# 这里路由器连接了几个网络,就执行几次
network 网段1
network 网段2
# 版本
version 2

OSPF

配置完PC和Router的IP后,对路由器进行配置路由协议

router ospf 10# 开启OSPF进程,进程号为10
router-id 30.0.0.1# 设置路由器的ID为30.0.0.1,路由器在一个自治系统(AS)中的唯一标识符
network 192.168.2.0 0.0.0.255 area 0# 将192.168.2.0/24网络加入到OSPF进程中,指定该接口所在区域为区域0
network 192.168.4.0 0.0.0.255 area 0
network 30.0.0.0 0.0.0.255 area 0

静态路由

enable
conf t
# 目标网段,下一跳的ip(下一跳转发到192.168.3.2(该路由器直连的另一个路由器的某个端口的ip))
ip route 192.168.2.0 255.255.255.0 192.168.3.2
end
show ip route

# show ip route时出现,Gateway of last resort is not set
# 表示没有配置该路由器的默认路由

# 缺省路由是静态路由的一种特殊情况
# 缺省路由只能存在于末梢网络中,就是边界路由器上
ip route 0.0.0.0 0.0.0.0 192.168.3.2

猜你喜欢

转载自blog.csdn.net/qq_53318060/article/details/131642691