今天寫一下靜态位址轉換吧,比較簡單,屬于一個私有位址與一個公網位址的一對一固定轉換。如果一個機關有一個網絡伺服器,就把這個位址給它吧~
先畫一張拓撲圖吧:
關鍵指令:
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
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
end
Router_1#sh run
Current configuration : 461 bytes
hostname Router_1
ip address 200.1.0.3 255.255.255.248
ip address 200.1.1.254 255.255.255.0
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
看看企業内部網絡DNS伺服器的設定吧~
大家注意到,我們在路由器0上配置了兩個靜态位址轉換,200.0.0.1給了伺服器使用,200.0.0.4給了PC0,這是為了測試。OK,測試開始:
下來我們測試一下從公網登入WEB伺服器如何,選擇PC3
成功了!
希望大家開心啊~
一起加油!
本文轉自 tiger506 51CTO部落格,原文連結:http://blog.51cto.com/tiger506/84452,如需轉載請自行聯系原作者