实验目的

局域网是怎么连接到互联网的呢?

实验步骤

1.首先依照拓扑图配置好各个设备的IP等参数

pc:192.168.1.1 24 192.168.1.254

ar2:[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 100.1.1.1 24
ar1:[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 100.1.1.10 24	

2.现在ping测试一下 可以发现现在是ping不通的

3.因为外网路由器中192.168的路由 所以需要使用nat地址转换

ar2:

[Huawei]acl name neiwang1 basic

[Huawei-acl-basic-neiwang1]rule permit source 192.168.0.0 0.0.255.255

[Huawei]nat address-group 1 100.1.1.2 100.1.1.6

[Huawei]int g0/0/1

[Huawei-GigabitEthernet0/0/1]dis acl all

Total quantity of nonempty ACL number is 1

Basic ACL neiwang1 2999, 1 rule

Acl's step is 5

rule 5 permit source 192.168.0.0 0.0.255.255

[Huawei-GigabitEthernet0/0/1]nat outbound 2999 address-group 1

4.nat转换完成 ping测试 成功连接到外网

实验完成