资讯动态

ospf配置

发布时间:2026/8/17 8:43:55 来源:尧图企业网站定制
一、地址规划1️⃣ 各网段PC1网段 10.47.21.0/24Server1网段 10.47.31.0/24PC2网段 10.47.6.0/24Client2网段 10.47.3.0/24Server2网段 10.47.4.0/24Server3网段 10.47.2.0/24Client1网段 10.47.11.0/24Client3网段 10.47.5.0/242️⃣ 路由器互联AR1—AR210.47.12.0/24AR2—AR310.47.23.0/24二、核心要求对应说明要求实现点PC1 ping PC2/Server3全网 OSPFLSW1只查OSPF三层交换机启用OSPFClient1 → Server1 HTTP路由 Server开HTTPClient2 → Server2 HTTPVLAN 路由三、路由器配置 AR1 配置sysname AR1interface GigabitEthernet0/0/0ip address 10.47.12.1 255.255.255.0interface GigabitEthernet0/0/1ip address 10.47.1.1 255.255.255.0interface GigabitEthernet0/0/2ip address 10.47.11.254 255.255.255.0ospf 1ospf router-id 1.1.1.1area 0network 10.47.12.0 0.0.0.255network 10.47.1.0 0.0.0.255network 10.47.11.0 0.0.0.255 AR2 配置sysname AR2interface GigabitEthernet0/0/0ip address 10.47.12.2 255.255.255.0interface GigabitEthernet0/0/1ip address 10.47.21.254 255.255.255.0interface GigabitEthernet0/0/2ip address 10.47.23.2 255.255.255.0ospf 1ospf router-id 2.2.2.2area 0network 10.47.12.0 0.0.0.255network 10.47.21.0 0.0.0.255network 10.47.23.0 0.0.0.255 AR3 配置重点sysname AR3interface GigabitEthernet0/0/2ip address 10.47.23.3 255.255.255.0interface GigabitEthernet0/0/1ip address 10.47.31.254 255.255.255.0# 子接口VLAN50interface GigabitEthernet0/0/0.10dot1q termination vid 50ip address 10.47.5.254 255.255.255.0arp broadcast enable# 子接口VLAN60interface GigabitEthernet0/0/0.20dot1q termination vid 60ip address 10.47.6.254 255.255.255.0arp broadcast enableospf 1ospf router-id 3.3.3.3area 0network 10.47.23.0 0.0.0.255network 10.47.31.0 0.0.0.255network 10.47.5.0 0.0.0.255network 10.47.6.0 0.0.0.255四、交换机配置 S5700-LSW1三层交换机sysname LSW1vlan batch 10 20 30 40interface Vlanif10ip address 10.47.1.254 255.255.255.0interface Vlanif20ip address 10.47.2.254 255.255.255.0interface Vlanif30ip address 10.47.3.254 255.255.255.0interface Vlanif40ip address 10.47.4.254 255.255.255.0# 接口划分interface GigabitEthernet0/0/1port link-type accessport default vlan 10interface GigabitEthernet0/0/2port link-type accessport default vlan 40interface GigabitEthernet0/0/3port link-type accessport default vlan 20interface GigabitEthernet0/0/4port link-type accessport default vlan 30# 上联AR1interface GigabitEthernet0/0/0port link-type accessport default vlan 10# OSPF重点要求2ospf 1ospf router-id 4.4.4.4area 0network 10.47.1.0 0.0.0.255network 10.47.2.0 0.0.0.255network 10.47.3.0 0.0.0.255network 10.47.4.0 0.0.0.255 验证命令要求2display ip routing-table protocol ospf S3700-LSW2二层交换机sysname LSW2vlan batch 50 60interface e0/0/2port link-type accessport default vlan 50interface e0/0/3port link-type accessport default vlan 60# 上联AR3interface e0/0/1port link-type trunkport trunk allow-pass vlan 50 60五、终端配置PC1IP: 10.47.21.10GW: 10.47.21.254PC2IP: 10.47.6.10GW: 10.47.6.254Client1IP: 10.47.11.200GW: 10.47.11.254Client2IP: 10.47.5.200GW: 10.47.5.254Client3IP: 10.47.3.200GW: 10.47.3.254六、服务器配置Server1HTTPIP: 10.47.31.100GW: 10.47.31.254开启HTTP服务Server2HTTPIP: 10.47.4.100GW: 10.47.4.254开启HTTP服务Server3IP: 10.47.2.100GW: 10.47.2.254 常见错误提醒很重要❌ OSPF漏宣告网段❌ VLAN没打通特别是AR3子接口❌ 网关配置错误❌ 二层交换机 trunk 没放行 VLAN

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价