当前位置 - 股票行情交易網 - 股票行情 - cisco 2811 怎麽做公網IP映射到內網IP呢?

cisco 2811 怎麽做公網IP映射到內網IP呢?

R1:FastEthernet0/0? 222.1.1.1

FastEthernet0/1? 192.168.2.254

C1 IP:192.168.2.200

R2:FastEthernet0/0? 222.1.1.2

Loopback0? 8.1.1.1

R1 上的配置:

interface FastEthernet0/0

ip address 222.1.1.1 255.255.255.0

ip nat outside 註意接外網的接口用outside

duplex auto

speed auto

!

interface FastEthernet0/1

ip address 192.168.2.254 255.255.255.0

ip nat inside接內網的接口用Inside

duplex auto

speed auto

!

ip nat pool servers 222.1.1.10 222.1.1.10 netmask 255.255.255.0建立地址池

ip nat inside source list 101 pool servers overload 做映射

ip classless

ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

no ip http server

!

access-list 101 permit ip host 192.168.2.200 any建立acl,妳需要映射出去的IP

以下是測試結果:R2為外網ping 192.168.2.200

R2#ping 192.168.2.200

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.200, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 24/36/80 ms

以下是在R1上debug ip nat

00:31:46: NAT: s=192.168.2.200->222.1.1.10, d=222.1.1.2 [1794]

00:31:46: NAT: s=192.168.2.200->222.1.1.10, d=222.1.1.2 [1795]

00:31:46: NAT: s=192.168.2.200->222.1.1.10, d=222.1.1.2 [1796]

00:31:46: NAT: s=192.168.2.200->222.1.1.10, d=222.1.1.2 [1797]

00:31:46: NAT: s=192.168.2.200->222.1.1.10, d=222.1.1.2 [1798]

所用的外網IP就是建立地址池的222.1.1.10