一、拓撲圖ide
lsw2和ar1採用ospf實現局域網互通,ar1經過PAT將局域網內數據包轉發到公網,能夠訪問模擬公網路由AR2的IP:10.10.1.2測試
局域網配置vlan和ip3d
LSW2blog
interface Vlanif1ip
ip address 192.168.1.2 255.255.255.0 路由
#get
interface Vlanif10it
ip address 192.168.10.1 255.255.255.0 io
#class
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
AR1
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.10.1.1 255.255.255.0
AR2
interface GigabitEthernet0/0/0
ip address 10.10.1.2 255.255.255.0
宣告局域網被ospf路由
LSW2
ospf 1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.10.0 0.0.0.255
AR1
ospf 1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
分別在LSW2和AR1添加默認路由
LSW2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
AR1
ip route-static 0.0.0.0 0.0.0.0 10.10.1.2
在AR1配置PAT
acl number 2000
rule 5 permit source 192.168.10.0 0.0.0.255
interface GigabitEthernet0/0/1
nat outbound 2000
測試結果: