交换机配置
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl;Z.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done
[Huawei]sy LSW1
[LSW1]
[LSW1]INT V
[LSW1]INT Vlanif 10
[LSW1-Vlanif10]IP ADD 192.168.1.254 24
[LSW1]INT Vlanif 20
[LSW1-Vlanif20]IP ADD 192.168.2.254 24
[LSW1-Vlanif20]Q
[LSW1]INT G0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type A
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 10
[LSW1-GigabitEthernet0/0/2]Q
[LSW1]INT G0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type access
[LSW1-GigabitEthernet0/0/3]port default vlan 20
[LSW1-GigabitEthernet0/0/3]Q
[LSW1]INT Vlanif 1
[LSW1-Vlanif1]IP ADD 192.168.11.1 24
[LSW1-Vlanif1]Q
[LSW1]INT G0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 1
[LSW1-GigabitEthernet0/0/1]Q
[LSW1]IP route-static 0.0.0.0 0 192.168.11.2
R1配置
<Huawei>U T M
Info: Current terminal monitor is off.
<Huawei>SY
Enter system view, return user view with Ctrl;Z.
[Huawei]INT G0/0/0
[Huawei-GigabitEthernet0/0/0]IP ADD 192.168.11.2 24
[Huawei-GigabitEthernet0/0/0]Q
[Huawei]INT G0/0/1
[Huawei-GigabitEthernet0/0/1]IP ADD 192.168.12.1 24
[Huawei-GigabitEthernet0/0/1]Q
[Huawei]IP route-static 192.168.1.0 24 192.168.11.1
[Huawei]IP route-static 192.168.2.0 24 192.168.11.1
[Huawei]IP route-static 0.0.0.0 0 192.168.12.2
<Huawei>U T M
[R2]INT G0/0/0
[R2-GigabitEthernet0/0/0]IP ADD 192.168.12.2 24
[R2-GigabitEthernet0/0/0]Q
[R2]INT G0/0/1
[R2-GigabitEthernet0/0/1]IP ADD 23.1.1.1 24
[R2-GigabitEthernet0/0/1]Q
[R2]IP route-static 192.168.1.0 24 192.168.12.1
[R2]IP route-static 192.168.2.0 24 192.168.12.1
[R2]IP route-static 0.0.0.0 0 23.1.1.2
[R2]acl 2000
[R2-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R2-acl-basic-2000]Q
[R2]nat address-group 0 23.1.1.10 23.1.1.20 设置配对地址范围
[R2]INT G0/0/1
[R2-GigabitEthernet0/0/1]NAT outbound 2000 address-group 0 no-pat 将vlan10分配到acl2000
[R2-GigabitEthernet0/0/1]Q
R2]acl 2001
[R2-acl-basic-2001]rule permit source 192.168.2.0 0.0.0.255
[R2-acl-basic-2001]q
[R2]nat address-group 1 32.0.0.10 32.0.0.20 设置配对地址范围
[R2-GigabitEthernet0/0/1]nat outbound 2001 address-group 1 no-pat 将vlan20分配到acl2001
<Huawei>
<Huawei>U T M
Info: Current terminal monitor is off.
<Huawei>SY
Enter system view, return user view with Ctrl;Z.
[Huawei]SY R3
[R3]INT G0/0/0
[R3-GigabitEthernet0/0/0]IP ADD 23.1.1.2 24
[R3-GigabitEthernet0/0/0]INT G0/0/1
[R3-GigabitEthernet0/0/1]IP ADD 100.1.1.254 24
[R3-GigabitEthernet0/0/1]Q
[Huawei]ip route-static 0.0.0.0 0 23.1.1.1 分配到不同网段要写静态路由;同一网段不用写