CCNA基础实验--NAT之二Static NAT
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://tiger506.blog.51cto.com/318536/84452 |
今天写一下静态地址转换吧,比较简单,属于一个私有地址与一个公网地址的一对一固定转换。如果一个单位有一个网络服务器,就把这个地址给它吧~
先画一张拓扑图吧:
![]() 关键命令:
ip nat inside
ip nat outside
ip nat inside source static inside_local_address inside_global_address
在这个实验中,除了服务器上的ip地址为静态分配外,各主机地址均为DHCP分配
在该网络拓扑中,外网的主机设置的DNS服务器的地址也指向Server0,只不过要用Iside global 地址哦!
详细命令如下:
Router_0#sh run
Building configuration... Current configuration : 678 bytes
! version 12.3 no service password-encryption ! hostname Router_0 ! ! ! ! interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 ip nat inside duplex auto speed auto ! interface FastEthernet0/1 ip address 200.1.0.2 255.255.255.248 ip nat outside duplex auto speed auto ! interface Vlan1 no ip address shutdown ! ip nat inside source static 192.168.1.1 200.1.0.1 ip nat inside source static 192.168.1.2 200.1.0.4 ip classless ip route 0.0.0.0 0.0.0.0 200.1.0.3 ! ! ! ip dhcp pool tiger network 192.168.1.0 255.255.255.0 default-router 192.168.1.254 dns-server 192.168.1.1 ! line con 0 password cisco login line vty 0 4 password cisco login ! ! end Router_1#sh run
Building configuration... Current configuration : 461 bytes
! version 12.3 no service password-encryption ! hostname Router_1 ! ! ! ! interface FastEthernet0/0 ip address 200.1.0.3 255.255.255.248 duplex auto speed auto ! interface FastEthernet0/1 ip address 200.1.1.254 255.255.255.0 duplex auto speed auto ! interface Vlan1 no ip address shutdown ! ip classless ! ! ! ip dhcp pool zwin network 200.1.1.0 255.255.255.0 default-router 200.1.1.254 dns-server 200.1.0.1 ! line con 0 line vty 0 4 login ! ! end 看看企业内部网络DNS服务器的设置吧~
![]() 大家注意到,我们在路由器0上配置了两个静态地址转换,200.0.0.1给了服务器使用,200.0.0.4给了PC0,这是为了测试。OK,测试开始:
好了,先用公司网络内的PC0访问一下www.51cto.com吧:
![]() 下来我们测试一下从公网登录WEB服务器如何,选择PC3
![]() 成功了!
希望大家开心啊~
一起加油! 本文出自 “tiger506” 博客,请务必保留此出处http://tiger506.blog.51cto.com/318536/84452 本文出自 51CTO.COM技术博客 |






tiger506
博客统计信息
热门文章
最新评论
友情链接