主要内容:ospf rip 重分发 单臂路由
拓扑图
按照拓扑图搭建拓扑
Pc1 pc2配置IP网关
Sw1 0/0/1接口配置trunk
[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
创建vlan2 vlan3
[sw1]vlan batch 2 3
将接口加入到vlan
[sw1]interface Ethernet 0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 3
[sw1]interface Ethernet 0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2
激活R1 G0/0/0接口
[r1]interface GigabitEthernet0/0/0
[r1]undo shutdown
创建子接口开启arp广播 为vlan2提供服务 配置IP
[r1]interface GigabitEthernet 0/0/0.2
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1-GigabitEthernet0/0/0.2]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.2]ip address 192.168.2.1 24
创建子接口开启arp广播 为vlan3提供服务 配置IP
[r1]interface GigabitEthernet 0/0/0.3
[r1-GigabitEthernet0/0/0.3]arp broadcast enable
[r1-GigabitEthernet0/0/0.3]dot1q termination vid 3
[r1-GigabitEthernet0/0/0.3]ip address 192.168.3.1 24
配置IP
R1
R2
R3
R4
R1配置ospf并宣告网络
[r1]ospf router-id 1.1.1.1
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
R2配置ospf并宣告网络
[r2]ospf router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 192.168.30.0 0.0.0.255
R3配置ospf并宣告网络
[r3]ospf router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 192.168.30.0 0.0.0.255
配置直连重分发
[r1]ospf 1
[r1-ospf-1]import-route direct type 2
测试
R4配置rip
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 172.16.0.0
[r4-rip-1]network 192.168.10.0
R1配置rip
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.10.0
测试rip
将rip发布到ospf
[r1]ospf 1
[r1-ospf-1]import-route rip cost 1
将ospf发布到rip
[r1]rip 1
[r1-rip-1]import-route ospf cost 1
测试
配置rip重分发
[r1-ospf-1]rip 1
[r1-rip-1]import-route direct
测试
桥接配置IP网关
R3配置ospf重分发
[r3]ospf 1
[r3-ospf-1]import-route direct type 2
测试
R4配置rip汇总 [r4-GigabitEthernet0/0/0]rip
summary-address 172.16.0.0 255.255.0.0
查看
配置ospf汇总 [r1]ospf 1 [r1-ospf-1]asbr-summary 172.16.0.0 255.255.0.0 验证
配置telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):7
[r1-ui-vty0-4]set authentication password cipher pwd@123
[r1-ui-vty0-4]user privilege level 3
验证