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

  首先,配置各接口的IP地址。内网使用私有IP.外网使用公网IP.并指定其属于内外接口。

  其次,定义静态建立IP地址之间的静态映射。

  最后,指定其默认路由。

Router>en (进入特权模式)

            Router#config   (进入全局配置模式)

            Configuring from terminal, memory, or network [terminal]?

            Enter configuration commands, one per line.   End with CNTL/Z.

            Router(config)#ho R3 (命名为R3

            R3(config)#no ip domain-lo

            (关闭域名查询,在实验环境中,敲入错误的命令,它将进行域名查询,故关闭他)

            R3(config)#line c 0 (进入线路CONSOLE接口0下)

            R3(config-line)#logg syn (启用光标跟随,防止日志信息冲断命令显示的位置)

            R3(config-line)#exec-t 0 0 (防止超时,0 0 为永不超时)

            R3(config-line)#exit

            R3(config)#int e0 (进入以太网接口下)

            R3(config-if)#ip add 192.168.1.1 255.255.255.0 (设置IP地址)

            R3(config-if)#ip nat inside (设置为内部接口)

            R3(config-if)#no shut

            R3(config-if)#exit

            R3(config)#int ser1   (进入串口下)

            R3(config-if)#ip add 100.0.0.1 255.255.255.0

            R3(config-if)#no shut

            R3(config-if)#ip nat outside (设置为外部接口)

            R3(config-if)#exit

            R3(config)#ip nat inside source static 191.168.1.1 100.0.0.1

            (设置静态转换,其中ip nat inside source NAT转换关键字,这里是静态,故为STATIC

            R3(config)#ip classless

            R3(config)#ip route <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0.0.0.0 0.0.0.0 s0(这里是出口或者下一跳地址)

            R3(config)#exit