sautostart = False
[localhost]
port = 7200
udp = 10000
[[router r1]]
image = ..\images\unzip-c3640-js-mz.124-10.bin
model = 3640
console = 3001
ram = 128
confreg = 0x2142
exec_area = 64
mmap = False
slot0 = NM-1FE-TX
slot1 = NM-1FE-TX
f0/0 = pc1 f0/0
f1/0 = S1 1
idlepc = 0x604ec6b0
[[router pc1]]
image = ..\images\unzip-c3640-js-mz.124-10.bin
model = 3640
console = 3002
ram = 128
confreg = 0x2142
exec_area = 64
mmap = False
slot0 = NM-1FE-TX
idlepc = 0x604ec6b0
[[ethsw S1]]
1 = access 1 NIO_gen_eth:\Device\NPF_{FBB0162E-4F07-4EB8-A161-EB8AE9451F73}
配置端口关系
R1(config)#int f0/0 进入端口F0/0
R1(config-if)#ip add 61.153.177.1 255.255.255.0 配置IP
R1(config-if)#ip nat outside 配置公网端口为outside代表出去
R1(config-if)#no shut 打开端口
R1(config-if)#int f1/0 进入端口F1/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0 配置IP
R1(config-if)#ip nat inside 配置内网端口为Inside代表进来
R1(config-if)#no shut 打开端口
配置静态NAT
R1(config)#ip nat source static 192.168.1.200 61.153.177.1
配置动态NAT
R1(config)#access-list 1 permit any 通过ACL表示所有内网地址都符合修改条件
R1(config)#ip nat pool king 61.153.177.1 61.153.177.2 netmask 255.255.255.0 通过地址池king表示修改后的地址范围为61.153.177.1到2
R1(config)#ip nat source list 1 pool king 将符合ACL 1的IP地址修改成地址池KING中的IP
配置PAT
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 通过ACL表示192.168.1.0网络地址都符合修改条件
R1(config)#ip nat source list 1 interface f0/0 overload 将符合ACL 1的ip地址修改成f0/0端口地址