静态NAT配置<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Router(config)#  ip  nat  inside  source  static   IP 地址   转换 IP 地址   extendable

 

在内部端口上启用NAT

Router(config-if)#  ip  nat  inside

 

在外部端口上启用NAT

Router(config-if)#  ip  nat  outside

 

NAT端口映射

Router(config)#  ip  nat  inside  source  static  协议  源地址端口号  目的地址  端口号    extendable

 

动态NAT

1:定义内部网络中允许访问外网的ACL
   Router(config)# access-list  1  permit  x.x.x.x  x.x.x.x

 

2定义合法的IP地址池

   Router(config)#  ip  nat  pool   地址池名称  起始地址  终止地址   natmask   子网掩码

3实现网络地址转换

   Router(config)#  ip  nat  inside  source  list  ACL列表号   pool  地址池名称

overload [q1] 

 

4:在内部和外部端口上启用NAT

 

 

端口复用IP地址的转换
Router(config)#  ip  nat  inside  source  ACL 列表号   interface 

 fastEthernet  0/x  overload

 

显示当前存在的NAT转换
Router(config)#  show  ip  nat  translations

 

查看NAT的统计信息
Router(config)#  show  ip  nat  statistice

 

清除NAT转换表中的所有条目
Router(config)#  clear  ip  nat  translation

 

 

OSPF 的配置

1 :配置Loopback接口地址

Router(config)#  interface  loopback  0

Router(config-if)#  ip  address  x.x.x.x   x.x.x.x

 

2 :启动OSPF路由进程

    Router(config)#  router ospf  进程号

 

3 :指定路由器的Router  ID

    Router(config-router)#  router-id  loopback 接口的地址

 

4: 指定OSPF协议运行的接口和所在的区域
   Router(config-router)#  network  网络IP地址   反码   area   区域号

 

 [q1] 加这个就表示做PAT  端口复用