NAT地址转换过程
地址转换分为3类:
1、静态NAT
2、动态NAT
3、easyIp
SW1配置如下:
vlan batch 10 20 30 40
cluster enable
ntdp enable
ndp enable
drop illegal-mac alarm
diffserv domain default
drop-profile default
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
interface Vlanif1
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
interface Vlanif40
ip address 11.0.0.2 255.255.255.0
interface MEth0/0/1
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
interface GigabitEthernet0/0/5
port link-type access
port default vlan 40
interface GigabitEthernet0/0/6
port link-type access
port default vlan 10
R1的配置如下:
nat address-group 1 212.0.0.100 212.0.0.200
nat static global 8.8.8.8 inside 192.168.10.10 netmask 255.255.255.255
interface GigabitEthernet0/0/0
ip address 11.0.0.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 12.0.0.1 255.255.255.0
nat server protocol tcp global 9.9.9.9 www inside 192.168.10.100 www
nat outbound 2000 address-group 1 no-pat
nat outbound 3000
nat static enable
interface GigabitEthernet0/0/2
interface NULL0
ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
ip route-static 192.168.10.0 255.255.255.0 11.0.0.2
ip route-static 192.168.20.0 255.255.255.0 11.0.0.2
ip route-static 192.168.30.0 255.255.255.0 11.0.0.2
R2的配置如下:
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 13.0.0.1 255.255.255.0
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 114.114.114.114 255.255.255.255
ip route-static 8.8.8.8 255.255.255.255 12.0.0.1
ip route-static 9.9.9.9 255.255.255.255 12.0.0.1
ip route-static 212.0.0.0 255.255.255.0 12.0.0.1