以R3为例配置默认路由
//在R3中配置默认路由,使每个未直接连接的网络均可访问
ip route 0.0.0.0 0.0.0.0 S0/0/1
配置IPv4静态路由和默认路由
静态路由:网络管理员为创建可靠和安全路由而手动输入的路由
拓扑:
在单区域中配置OSPFv2
VLAN间路由
地址分配表:
地址分配表:
以R1为例
R1(config)# interface g0/0
R1(config-if)# no shutdown
R1(config-if)# interface g0/0.10
R1(config-subif)# encapsulation dot1Q 10
R1(config-subif)# ip address 172.17.10.1 255.255.255.0
R1(config-subif)# interface g0/0.20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip address 172.17.20.1 255.255.255.0
R1(config-subif)# interface g0/0.30
R1(config-subif)# encapsulation dot1Q 30
R1(config-subif)# ip address 172.17.30.1 255.255.255.0
R1(config-subif)# interface g0/0.88
R1(config-subif)# encapsulation dot1Q 88 native
R1(config-subif)# ip address 172.17.88.1 255.255.255.0
R1(config-subif)# interface g0/0.99
R1(config-subif)# encapsulation dot1Q 99
R1(config-subif)# ip address 172.17.99.1 255.255.255.0
R1(config-subif)# dowrite
VLAN和端口分配表:
以R1为例(R1的id为
//1.启动OSPF
router ospf 110
//2.使用路由器ID来唯一标识路由器
router id 1.1.1.1
//3.启用OSPF R1上任何匹配network命令中的网络地址的接口都将启用 可用于发送和接收OSPF数据包
//network 网络地址 通配符掩码(255-掩码) area 0
network 172.16.1.0 0.0.0.255 area 0
network 172.16.3.0 0.0.0.3 area 0
network 192.168.10.4 0.0.0.3 area 0
//4.配置被动接口
passive-interface g0/0
拓扑:
地址分配表:
以在R1上配置为例
//1.使用适当的命令在R1上创建默认路由 以使所有互联网流量通过S0/0/1离开网络
R1(config)# ip route 0.0.0.0 0.0.0.0 s0/0/1
//2.进入RIP协议配置模式
R1(config)# router rip
//3.使用RIP协议版本2并禁用网络汇总
R1(config-router)# version 2
R1(config-router)# no auto-summary
//4.为连接到R1的网络配置RIP
R1(config-router)# network 192.168.1.0
R1(config-router)# network 192.168.2.0
//5.配置不含路由器的LAN端口 这样端口就不会发出任何路由信息 (末节网络,被动接口)
R1(config-router)# passive-interface gig0/0 //(gig0/0 = g0/0)
//6.使用其他RIP路由器通知默认路由
R1(config-router)# default-information originate
//7.保存配置
默认路由/最后选用网关:在不存在其他通往目标网络的已知路由时路由器所使用的网络路由。静态路由用于将流量路由到特定网络。
拓扑:
拓扑:
文章为作者独立观点,不代表股票交易接口观点