文章目錄
參考拓撲源碼:【GitHub】git
實驗拓撲以下:github
子網劃分
- 總部—上海
- 給定網段:12.1.1.0/24
- 劃分網段:12.1.1.0/30
- 可用:12.1.1.1/30、12.1.1.2/30
- 總部—廣州
- 給定網段:13.1.1.0/24
- 劃分網段:13.1.1.0/30
- 可用:13.1.1.1/30、13.1.1.2/30
- 總部—SW1
- 給定網段:192.168.5.0/24
- 劃分網段:192.168.5.30/24
- 可用:192.168.5.1/30、192.168.5.2/30
配置IP地址
- AR1配置
[AR1]int g0/0/0 [AR1-GigabitEthernet0/0/0]ip ad 192.168.43.2 24 [AR1-GigabitEthernet0/0/0]int g0/0/1 [AR1-GigabitEthernet0/0/1]ip ad 192.168.5.1 30 [AR1-GigabitEthernet0/0/1]int g2/0/0 [AR1-GigabitEthernet2/0/0]ip ad 12.1.1.1 30 [AR1-GigabitEthernet2/0/0]int g2/0/1 [AR1-GigabitEthernet2/0/1]ip ad 13.1.1.1 30
- AR2配置
[AR2]int g0/0/1 [AR2-GigabitEthernet0/0/1]ip ad 12.1.1.2 30 [AR2-GigabitEthernet0/0/1]int g0/0/0 [AR2-GigabitEthernet0/0/0]ip ad 192.168.3.254 24
- AR3配置
[AR3]int g0/0/1 [AR3-GigabitEthernet0/0/1]ip ad 13.1.1.2 30 [AR3-GigabitEthernet0/0/1]int g0/0/0 [AR3-GigabitEthernet0/0/0]ip ad 192.168.4.254 24
- SW1配置
[SW1]int vlan [SW1]int Vlanif 1 [SW1-Vlanif1]ip ad 192.168.5.2 30 [SW1]vlan batch 100 200 [SW1]int Vlanif 100 [SW1-Vlanif100]ip ad 192.168.1.254 24 [SW1-Vlanif100]q [SW1]int Vlanif 200 [SW1-Vlanif200]ip ad 192.168.2.254 24 # 配置鏈路聚合 [SW1]int Eth-Trunk 1 [SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/4 [SW1-Eth-Trunk1]port link-type trunk [SW1-Eth-Trunk1]port trunk allow-pass vlan all
- SW2配置
[SW2]vlan batch 100 200 [SW2]int e0/0/1 [SW2-Ethernet0/0/1]port link-type access [SW2-Ethernet0/0/1]port default vlan 100 [SW2-Ethernet0/0/1]int e0/0/2 [SW2-Ethernet0/0/2]port link-type access [SW2-Ethernet0/0/2]port default vlan 200 # 配置鏈路聚合 [SW2]int Eth-Trunk 1 [SW2-Eth-Trunk1]trunkport Ethernet 0/0/3 to 0/0/4 [SW2-Eth-Trunk1]port link-type trunk [SW2-Eth-Trunk1]port trunk allow-pass vlan all
配置OSPF動態路由協議
- AR1配置
[AR1]ospf [AR1-ospf-1]area 0 [AR1-ospf-1-area-0.0.0.0]net 192.168.5.1 0.0.0.0 [AR1-ospf-1-area-0.0.0.0]net 12.1.1.1 0.0.0.0 [AR1-ospf-1-area-0.0.0.0]net 13.1.1.1 0.0.0.0
- AR2配置
[AR2]ospf [AR2-ospf-1]area 0 [AR2-ospf-1-area-0.0.0.0]net 12.1.1.2 0.0.0.0 [AR2-ospf-1-area-0.0.0.0]net 192.168.3.254 0.0.0.0
- AR3配置
[AR3]ospf [AR3-ospf-1]area 0 [AR3-ospf-1-area-0.0.0.0]net 192.168.4.254 0.0.0.0 [AR3-ospf-1-area-0.0.0.0]net 13.1.1.2 0.0.0.0
- SW1配置
[SW1]ospf [SW1-ospf-1]area 0 [SW1-ospf-1-area-0.0.0.0]net 192.168.5.2 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]net 192.168.1.254 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]net 192.168.2.254 0.0.0.0
PC端作連通性測試bash
配置NAT
[AR1]acl 2000 [AR1-acl-basic-2000]rule permit [AR1-acl-basic-2000]q [AR1]int g0/0/0 [AR1-GigabitEthernet0/0/0]nat outbound 2000 [AR1-GigabitEthernet0/0/0]q [AR1]ip route-static 0.0.0.0 0.0.0.0 192.168.43.1 [AR1]ospf [AR1-ospf-1]default-route-advertise //下發默認路由
分公司間不能互訪
- 配置高級ACL
[AR1]acl 3000 [AR1-acl-adv-3000]rule deny ip source 192.168.3.0 0.0.0.255 destination 192.168.4.0 0.0.0.255 [AR1-acl-adv-3000]q [AR1]int g2/0/0 [AR1-GigabitEthernet2/0/0]traffic-filter inbound acl 3000
實驗效果: 1. 內網能夠互通,PC端均可以訪問Internet; 2. PC3與PC4間不能互通
以上內容均屬原創,若有不詳或錯誤,敬請指出。
本文連接: https://blog.csdn.net/qq_45668124/article/details/105738503
版權聲明: 本博客全部文章除特別聲明外,均採用
CC BY-NC-SA 4.0 許可協議。轉載請註明出處!