频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

一个以太口做Nat实例

来源: 作者: 出处:巧巧读书 2006-07-25 进入讨论组

  interface Loopback0
  ip address 10.0.1.1 255.255.255.252
  ip nat outside
  !--- Creates a virtual interface called Loopback 0 and assigns an
  !--- IP address of 10.0.1.1 to it. Defines interface Loopback 0 as
  !--- NAT outside.
  !
  !
  interface Ethernet0
  ip address 192.168.1.2 255.255.255.0 secondary
  ip address 10.0.0.2 255.255.255.0
  ip Nat inside
  !--- Assigns a primary IP address of 10.0.0.2 and a secondary IP
  !--- address of 192.168.1.2 to Ethernet 0. Defines interface Ethernet 0
  !--- as NAT inside. The 192.168.1.2 address will be used to communicate
  !--- through the CM to the CMTS and the Internet. The 10.0.0.2 address
  !--- will be used to communicate with the local hosts.
  
  ip policy route-map Nat-loop
  !--- Assigns route-map "Nat-loop" to Ethernet 0 for policy routing.
  !
  ip Nat pool external 192.168.2.2 192.168.2.3 prefix-length 29
  ip Nat inside source list 10 pool external overload
  ip Nat inside source static 10.0.0.12 192.168.2.1
  !--- NAT is defined: packets matching access-list 10 will be
  !--- translated to an address from the pool called "external".
  !--- A static NAT translation is defined for 10.0.0.12 to be
  !--- translated to 192.168.2.1 (this is for host 2 which needs
  !--- to be accessed from the Internet).
  
  ip classless
  !
  !
  ip route 0.0.0.0 0.0.0.0 192.168.1.1
  ip route 192.168.2.0 255.255.255.0 Ethernet0
  !--- Static default route set as 192.168.1.1, also a static
  !--- route for network 192.168.2.0/24 directly attached to
  !--- Ethernet 0
  !
  !
  access-list 10 permit 10.0.0.0 0.0.0.255
  !--- Access-list 10 defined for use by NAT statement above.
  
  access-list 102 permit ip any 192.168.2.0 0.0.0.255
  access-list 102 permit ip 10.0.0.0 0.0.0.255 any
  !--- Access-list 102 defined and used by route-map "Nat-loop"
  !--- which is used for policy routing.
  !
  Access-list 177 permit icmp any any
  !--- Access-list 177 used for debug.
  !
  route-map Nat-loop permit 10
  match ip address 102
  set ip next-hop 10.0.1.2
  !--- Creates route-map "Nat-loop" used for policy routing.
  !--- Route map states that any packets matching access-list 102 will
  !--- have the next hop set to 10.0.1.2 and be routed "out" the
  !--- loopback interface. All other packets will be routed normally.
  !
  end
  NAT-router#巧 巧 读 书:http://www.qqread.com/net-manage/c904174081.html进入讨论组讨论。
收藏此文】【 】【打印】【关闭
较早的文章:关于NAT的配置实例

较新的文章:VLAN的定义及划分实例
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
讨论组问题推荐
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章