网中网 发表于 2015-11-5 02:27:54

NAT和GRE tunnel在思科路由器上的实现

  
  Topology:
  Client --- Router(NAT) ===GRE tunnel=== Router --- Server
  


  Client:90.1.0.8
  NAT Router outside: 90.1.0.1
  Server 1: 100.100.100.142
  Server 2: 100.100.100.162


  Server GW: 100.100.100.1
  


  关注点:
  1. outside必然是放在client的GW这一侧,这无可争议
  2. inside应该是放在tunnel上,而不是出口的物理interface上,在这里是Gi0/0/1
  


  NAT Router configuration:
  

ASR1004-5#sh run inter gi 0/0/0
Load for five secs: 0%/0%; one minute: 0%; five minutes: 0%
No time source, *05:56:27.549 UTC Tue Aug 5 2014
Building configuration...
Current configuration : 119 bytes
!
interface GigabitEthernet0/0/0
ip address 90.1.0.1 255.255.255.0
ip nat outside
negotiation auto
cdp enable
end
ASR1004-5#sh run inter gi 0/0/1
Load for five secs: 0%/0%; one minute: 0%; five minutes: 0%
No time source, *05:56:28.603 UTC Tue Aug 5 2014
Building configuration...
Current configuration : 108 bytes
!
interface GigabitEthernet0/0/1
ip address 202.202.202.5 255.255.255.0
negotiation auto
cdp enable
end
ASR1004-5#sh run inter tunnel 1
Load for five secs: 0%/0%; one minute: 0%; five minutes: 0%
No time source, *05:56:38.647 UTC Tue Aug 5 2014
Building configuration...
Current configuration : 149 bytes
!
interface Tunnel1
ip address 192.168.0.5 255.255.255.0
ip nat inside
tunnel source GigabitEthernet0/0/1
tunnel destination 202.202.202.15
end
ASR1004-5#sh run | in ip nat
ip nat inside
ip nat outside
ip nat inside source static 100.100.100.142 90.1.0.14
ip nat inside source static 100.100.100.162 90.1.0.16


  
  Server GW Router Configuration:
  

ASR1002-15#sh run inter gi 0/0/0
Load for five secs: 1%/0%; one minute: 1%; five minutes: 1%
Time source is NTP, *13:49:37.402 CST Tue Aug 5 2014
Building configuration...
Current configuration : 122 bytes
!
interface GigabitEthernet0/0/0
ip address 202.202.202.15 255.255.255.0
negotiation auto
ipv6 enable
cdp enable
end
ASR1002-15#sh run inter gi 0/0/1
Load for five secs: 1%/0%; one minute: 1%; five minutes: 1%
Time source is NTP, *13:49:40.811 CST Tue Aug 5 2014
Building configuration...
Current configuration : 121 bytes
!
interface GigabitEthernet0/0/1
ip address 100.100.100.1 255.255.255.0
negotiation auto
ipv6 enable
cdp enable
end
ASR1002-15#sh run inter tunnel 1
Load for five secs: 1%/0%; one minute: 1%; five minutes: 1%
Time source is NTP, *13:49:48.747 CST Tue Aug 5 2014
Building configuration...
Current configuration : 134 bytes
!
interface Tunnel1
ip address 192.168.0.15 255.255.255.0
tunnel source GigabitEthernet0/0/0
tunnel destination 202.202.202.5
end
ASR1002-15#



  

版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: NAT和GRE tunnel在思科路由器上的实现