PAT转换

作者: admin 分类: 网络 发布时间: 2019-04-29 00:44 浏览:1,750 次    

%title插图%num

  • R1:
enable

conf  t

interface  f0/0

ip add 200.1.1.1 255.255.255.0

no shutdown

int lo 1

ip add 100.1.1.1 255.255.255.0

end

show ip int brief
  • R2:
en

conf t

int f0/0

ip add 200.1.1.2 255.255.255.0

no sh

int f0/1

ip add 192.168.1.1 255.255.255.0

no sh

exit

access-list 1 permit 192.168.1.0 0.0.0.255

ip nat inside source lis 1 interface f0/0 overload

int f0/0

ip nat outside

int f0/1

ip nat inside

exit

ip route 0.0.0.0 0.0.0.0 200.1.1.1

注:以下方法也可以

  ip nat pool 名字 IP IP netmask 掩码

  ip  nat   inside  source list 1 pool 名字 overload
  • pc1:
 ip 192.168.1.2 255.255.255.0 192.168.1.1
  • 测试:

%title插图%num

在R1没有配置任何路由,能ping通100.1.1.1,说明已经成功实现转换。


温馨提示:如无特殊说明,本站文章均为作者原创,转载时请注明出处及相应链接!

发表评论