分公司和总公司之间已经建立×××(点对点的***),但是分公司和总公司的内部主机要想上网有得配NAT,使访问总公司的数据走×××隧道,访问internet的数据就不能走×××了,要经过NAT转换后才能上网,这些怎么配呀??? 都以CISCO的路由器为例。 谢谢帮忙!
呵呵,通过网上找了点资料,在packet5.2上做了个实验,测试成功了,希望对像我这样的初学者有所帮助。
网络拓扑大概描述一下:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

Router 0 模拟成Internet网(其实,就是没有私有IP地址路由的路由器,在说通俗点,现在×××技术常用来解决总部与分部跨越Internet网解决内部私有地址的连通性)
Router 1 为总部,Router 2为分部。
IP规划:
Router 0 FastEthernet0/0 200.1.1.1 FastEthernet0/1 100.1.1.1
Router 1 FastEthernet0/0 192.168.1.1 FastEthernet0/1 100.1.1.2
Router 2 FastEthernet0/0 200.1.1.2 FastEthernet0/1 192.168.2.1
PC1 :192.168.1.10/24
PC2: 192.168.2.10/24
实验要求让总部和分布的私有地址能通信!(大家可以按我的配置做一遍,红色为×××配置关键代码,在没配置×××时,PC1 是不能与PC2 相互Ping通),pc1和pc2能ping通外网
PC2: 192.168.2.10/24
实验要求让总部和分布的私有地址能通信!(大家可以按我的配置做一遍,红色为×××配置关键代码,在没配置×××时,PC1 是不能与PC2 相互Ping通),pc1和pc2能ping通外网
红色字体为配置***的关键,蓝色的为配置nat的关键
配置如下:
Router0 的配置(Internet):
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
no shutdown
interface FastEthernet0/1
ip address 100.1.1.1 255.255.255.0
no shutdown
Router 1的配置:
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
crypto isakmp key 2046 address 200.1.1.2
crypto ipsec transform-set tim esp-3des esp-md5-hmac
access-list 101 permit ip 192.168.1.0 <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0.0.0.255 192.168.2.0 0.0.0.255
crypto map tom 10 ipsec-isakmp
set peer 200.1.1.2
set transform-set tim
match address 101
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
Router0 的配置(Internet):
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
no shutdown
interface FastEthernet0/1
ip address 100.1.1.1 255.255.255.0
no shutdown
Router 1的配置:
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
crypto isakmp key 2046 address 200.1.1.2
crypto ipsec transform-set tim esp-3des esp-md5-hmac
access-list 101 permit ip 192.168.1.0 <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0.0.0.255 192.168.2.0 0.0.0.255
crypto map tom 10 ipsec-isakmp
set peer 200.1.1.2
set transform-set tim
match address 101
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
Ip nat inside
no shutdown
interface FastEthernet0/1
ip address 100.1.1.2 255.255.255.0
no shutdown
interface FastEthernet0/1
ip address 100.1.1.2 255.255.255.0
Ip nat outside
no shutdown
crypto map tom
no shutdown
crypto map tom
ip nat inside source list 111 interface FastEthernet0/1 overload
access-list 111 deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
access-list 111 permit ip 192.168.1.0 0.0.0.255 any
ip route 0.0.0.0 0.0.0.0 100.1.1.1
Router 2的配置:
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
crypto isakmp key 2046 address 100.1.1.2
crypto ipsec transform-set tim esp-3des esp-md5-hmac
!
crypto map tom 10 ipsec-isakmp
set peer 100.1.1.2
set transform-set tim
match address 101
access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
interface FastEthernet0/0
ip address 200.1.1.2 255.255.255.0
ip route 0.0.0.0 0.0.0.0 100.1.1.1
Router 2的配置:
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
crypto isakmp key 2046 address 100.1.1.2
crypto ipsec transform-set tim esp-3des esp-md5-hmac
!
crypto map tom 10 ipsec-isakmp
set peer 100.1.1.2
set transform-set tim
match address 101
access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
interface FastEthernet0/0
ip address 200.1.1.2 255.255.255.0
Ip nat outside
no shutdown
crypto map tom
interface FastEthernet0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
crypto map tom
interface FastEthernet0/1
ip address 192.168.2.1 255.255.255.0
Ip nat inside
no shutdown
no shutdown
ip nat inside source list 111 interface FastEthernet0/0 overload
access-list 111 deny ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 111 permit ip 192.168.2.0 0.0.0.255 any
ip route 0.0.0.0 0.0.0.0 200.1.1.1
ip route 0.0.0.0 0.0.0.0 200.1.1.1
转载于:https://blog.51cto.com/1115952/245788