案例只写SW1、SW1、AR1、AR4配置,SW2和SW4与SW3同理不做叙述。
/AR4配置
1.配置环回地址用于模拟外网地址151.110.20.26。
interface LoopBack1
ip address 151.110.20.26 255.255.255.0
2.配置G0接口模拟运营商网关110.128.36.38
interface GigabitEthernet0/0/0
ip address 110.128.36.38 255.255.255.0
AR1配置
1.创建acl规则2000,用于NAT转发外网,允许所有通过,并且在接口G2下使规则生效,
acl 2000
rule 5 permit source any
interface GigabitEthernet0/0/2
nat outbound 2000
2.配置接口IP
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.0
interface GigabitEthernet0/0/2
ip address 110.128.36