CCNA基础实验--NAT之二Static NAT

今天写一下静态地址转换吧,比较简单,属于一个私有地址与一个公网地址的一对一固定转换。如果一个单位有一个网络服务器,就把这个地址给它吧~
先画一张拓扑图吧:
关键命令:
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访问一下[url]www.51cto.com[/url]吧:
 
下来我们测试一下从公网登录WEB服务器如何,选择PC3
成功了!
希望大家开心啊~
一起加油!




本文转自 tiger506 51CTO博客,原文链接:http://blog.51cto.com/tiger506/84452,如需转载请自行联系原作者

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值