Router(config)#no ip domain-lookup

2、设置登录提示消息

Router(config)#banbanner motd  "This is a Test!"

3、控制台口令

Router(config)#line console 0
Router(config-line)#password cisco
Router(config-line)#login

4、虚拟终端口令

Router(config)#line vty 0 4 
Router(config-line)#password cisco123 
Router(config-line)#login 

5、使能口令

Router(config)#enable password cisco123

6、加密口令

Router(config)#enable secret cisco456

7、服务口令加密命令(将配置中明文密码设置成密文)

Router(config)#service password-encryption

注意:默认为不加密!!!

8、配置Console线路会话超时时间

Router(config)#line console 0
Router(config-line)#exec-timeout 5 10

注意:5代表分钟数,10代表秒数。分钟数和秒数都为0则代表永不超时!!!

9、配置Console线路会话日志同步

Router(config)#line con 0
Router(config-line)#logging synchronous

10、保存路由器的配置文件

Router#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]

11、检查路由器的系统硬件和配置寄存器

Router#show version
Cisco IOS Software [Everest], ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.6.4,RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Sun 08-Jul-18 04:33 by mcpre

Cisco IOS-XE software, Copyright (c) 2005-2018 by cisco Systems, Inc.
All rights reserved.  Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0.  The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY.  You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0.  For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.

ROM: IOS-XE ROMMON

Router uptime is 1 hours, 19 minutes, 2 seconds
Uptime for this control processor is 1 hours, 19 minutes, 2 seconds
System returned to ROM by power-on
System image file is "bootflash:isr4300-universalk9.16.06.04.SPA.bin"
Last reload reason: PowerOn

This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Suite License Information for Module:'esg'

--------------------------------------------------------------------------------
Suite                 Suite Current         Type           Suite Next reboot

--------------------------------------------------------------------------------
FoundationSuiteK9     None                  None           None

securityk9
appxk9

AdvUCSuiteK9          None                  None           None

uck9
cme - srst
cube

Technology Package License Information:

------------------------------------------------------------------------
Technology    Technology-package                  Technology-package
              Current              Type           Next reboot
------------------------------------------------------------------------
appxk9           None             None             None
uck9             None             None             None
securityk9       securityk9       Permanent        securityk9
ipbase           ipbasek9         Permanent        ipbasek9

cisco ISR4331/K9 (1RU) processor with 1795999K/6147K bytes of memory.
Processor board ID FLM232010G0
3 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
3207167K bytes of flash memory at bootflash:.

0K bytes of WebUI ODM Files at webui:.

Configuration register is 0x2102

注意:0x2102是路由器正常工作的值,其他值用于系统故障处理。

12、设置Debug查看实时抓包时设置输出时是毫秒

Router(config)#service timestamps debug datetime msec

一、思科网络设备配置基础

1.1 配置主机名、系统提示消息、接口描述

1、配置主机名

Router#config terminal 
Router(config)#hostname Cisco
Cisco(config)#

2、设置登录提示消息

Router(config)#banbanner motd  "This is a Test!"

3、设置接口描述

Cisco#configure terminal 
Cisco(config)#int g0/0/0
Cisco(config-if)#description Cisco

1.2 配置路由器接口

1、检查路由器接口

Router#show ip interface brief
Router#show protocols

2、根据网络拓扑配置路由器接口

Router#config terminal 
Router(config)#interface gigabitEthernet 0/0/0
Router(config-if)#

3、打开、关闭路由器接口

#关闭路由器接口
Router(config-if)#shutdown 
#打开路由器接口
Router(config-if)#no shutdown

注意:思科路由器接口默认是shutdown,需要人工开启!!!

4、配置接口IP地址

Router#config terminal 
Router(config)#interface gigabitEthernet 0/0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown

5、检查接口状态

Router(config-if)#do show int g0/0/0

1.3 配置CDP协议

CDP协议默认开启,LLDP协议默认关闭,使用lldp run开启. (1)查看CDP协议是否开启。

Cisco#show cdp interface 
Vlan1 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
GigabitEthernet0/0/0 is up, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
GigabitEthernet0/0/1 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
GigabitEthernet0/0/2 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds

(2)关闭CDP协议

Cisco#config terminal 
Cisco(config)#no cdp run 

(3)简要查看CDP协议邻居

Cisco#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID

(4)详细查看CDP协议邻居

Cisco#show cdp neighbors detail 

二、清空配置

2.1 交换机

之所以要删除两次,是因为交换机VLAN配置和Config配置文件是单独保存的。

Switch#delete vlan.dat

Switch#erase startup-config

2.2 路由器

Router#erase startup-config

三、配置静态路由

3.1 配置单向路由

配置完单向路由后,必须在相反的方向上再配置一条回来的静态路由。

Switch(config)#ip route 目的地址/目的地址段 目的地址掩码 下一跳地址

3.2 配置默认静态路由

一般末节网络需要配置默认静态路由,允许末节网络到达除本身外以外的所有网络。

Switch(config)#ip route 0.0.0.0 0.0.0.0 下一跳地址

四、检查路由表

S——静态路由,*——默认路由,合起来代表静态默认路由。

Router#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 1.1.1.1 to network 0.0.0.0

     1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       1.1.1.0/24 is directly connected, GigabitEthernet0/0/0
L       1.1.1.2/32 is directly connected, GigabitEthernet0/0/0
S*   0.0.0.0/0 [1/0] via 1.1.1.1

五、IOS文件备份及升级

5.1 IOS备份

本地使用copy flash tftp备份本地镜像文件到服务器。

Router#copy flash tftp 
Source filename []? isr4300-universalk9.16.06.04.SPA.bin(本地源文件名)
Address or name of remote host []? 1.1.1.1(服务器地址)
Destination filename [isr4300-universalk9.16.06.04.SPA.bin]? isr.bin(目的文件名,默认与源文件名相同)

5.2 IOS升级

1、检查设备与TFTP Server的连通性 2、使用show flash:检查设备Flash剩余空间,默认以B为单位。

Router#show flash: 

System flash directory:
File  Length   Name/status
  3   486899872isr4300-universalk9.16.06.04.SPA.bin
  2   28282    sigdef-category.xml
  1   227537   sigdef-default.xml
[487155691 bytes used, 2761893909 available, 3249049600 total]
3.17338e+06K bytes of processor board System flash (Read/Write)

3、从Tftp 服务器Copy ios镜像文件

Router#copy tftp: flash:
Address or name of remote host []? 1.1.1.1
Source filename []? asa923-k8.bin(服务器中文件名)
Destination filename [asa923-k8.bin]?(目的文件名,默认与源文件名相同)

4、设置启动文件,保存配置并重启

Router(config)#boot system flash isr4300-universalk9.16.06.04.SPA.bin
Router#copy running-config startup-config
Router#reload

六、路由器配置文件管理

1、复制运行文件到启动文件

Router#copy running-config startup-config 

2、复制启动文件到运行文件

Router#copy startup-config running-config 

3、从TFTP服务器下载运行文件到本地

Router#copy tftp: running-config
Address or name of remote host []? 1.1.1.1(TFTP服务器地址)
Source filename []? Router1-confg(TFTP服务器上运行文件名)
Destination filename [running-config]?(本地运行文件名)

4、从本地上传运行文件到TFTP服务器

Router#copy running-config tftp: 
Address or name of remote host []? 1.1.1.1(TFTP服务器地址)
Destination filename [Router-confg]? Router1-confg(TFTP服务器上运行文件名)

5、删除配置

Router#erase startup-config 

七、telnet配置

1、保证路由可通 2、设置登录认证方式 (1)设置虚拟终端线路号并进入虚拟线路终端配置模式(全局配置模式下)

Switch(config)#line vty <0-15>

(2)配置认证方式为无认证(虚拟线路终端配置模式下)

Switch(config-line)#no login

(3)配置认证方式为密码认证(虚拟线路终端配置模式下)

Switch(config-line)#login local

(4)配置虚拟线路登录认证密码-仅在密码认证时需要配置

Switch(config-line)#password <password>

3、创建本地用户并设置权限和密码(全局配置模式下,仅本地认证方式需要)

Switch(config)#user <user-name> [privilege <0-15>] password|secret <password>

4、配置特权模式登录密码(全局配置模式下)

Switch(config)#enable password|secret <password>

5、配置默认网关(全局配置模式下)

Switch(config)#ip default-gateway <gateway-ip>

八、SSH配置

1、配置思科设备的SSH服务 (1)配置主机名

Server(config)#hostname <hostname>

(2)设置域名

Server(config)#ip domain-name cisco.com

(3)设置用户名以及密码

Server(config)#user <user-name> secret <password>

(4)生成密钥

Server(config)#crypto key generate rsa 
The name for the keys will be: Server.cisco.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

(5)设置虚拟终端线路号并进入虚拟线路终端配置模式(全局配置模式下)

Server(config)#line vty 0 4

(6)配置认证方式为密码认证(虚拟线路终端配置模式下)

Server(config-line)#login local

(7)配置认证服务类型为SSH(虚拟线路终端配置模式下)

Server(config-line)#transport input ssh 

(8)配置SSH版本为2

Server(config)#ip ssh version 2

2、思科设备客户端连接SSH服务器

Client#ssh -l <用户名> -v 2 <目的主机ip>

九、路由器密码恢复

1、重启路由器,通过中断(Ctrl C)操作中止启动过程,此时进入remmon模式 2、在remmon模式下修改配置寄存器:confreg 0x2142 3、在remmon模式下重启路由器:Reset(重启后会进入出厂模式) 4、进入特权模式 5、Copy start run 6、修改密码:enable secret +密码 7、全局模式下输入:Config-register 0x2102 8、对有配置的接口:no shutdown 9、保存配置:Copy run start 10、结束

十、单臂路由

(1)在路由器物理接口上创建子接口,并设置封装协议为dot1q。这里需要注意只有VLAN1才需要在其后面加active

Router(config)#int g0/0/1.1
Router(config-subif)#encapsulation dot1Q 10(VLAN号)

Router(config)#int g0/0/1.2
Router(config-subif)#encapsulation dot1Q 20(VLAN号)

(2)在路由器设置子接口IP地址

Router(config)#int g0/0/1.1
Router(config-subif)#ip address 1.1.1.254 255.255.255.0

Router(config)#int g0/0/1.2
Router(config-subif)#ip address 2.2.2.254 255.255.255.0

(3)在交换机上将连接路由器的接口设置为Trunk类型。

Switch(config-if)#int g0/1
Switch(config-if)#switchport mode trunk

(4)在交换机上创建VLAN,并设置三层接口IP

Switch(config)#vlan 10 
Switch(config-vlan)#vlan 20 
Switch(config-vlan)#exit
Switch(config)#int vlan 10
Switch(config-if)#ip add 1.1.1.1 255.255.255.0
Switch(config-if)#int vlan 20
Switch(config-if)#ip add 2.2.2.2 255.255.255.0

十一、ACL配置命令

11.1 标准ACL配置命令(编号式)

1、创建 标准ACL列表 (1)使用1到99作为ACL序列号 (2)第一个字目分配的序列号是10,后续条目以10为增量递增 (3)默认通配符掩码是0.0.0.0(仅针对标准ACL) (4)remark用于向ACL添加说明。 (5)no access-list ACL编号可删除整个ACL列表。

Router(config)#access-list ACL编号 {permit | deny | remark} 源地址 源地址的掩码

2、在接口上调用ACL (1)接口视图下no ip access-group ACL编号 {in | out }可删除ACL

Router(config-if)#ip access-group ACL编号 {in | out }

3、利用ACL控制VTY线路访问 (1)创建ACL列表

Router(config)#access-list ACL编号 permit 允许登录的源地址 源地址的掩码

(2)进入VTY线路,并在入方向调用ACL

Router(config)#line vty 0 4
Router(config-line)#access-class ACL编号 in

11.2 扩展ACL配置命令(编号式)

1、创建 扩展ACL列表

Router(config)#access-list ACL编号 permit 源地址 通配符 目的地址 通配符 eq 协议端口号

2、在接口上调用ACL (1)接口视图下no ip access-group ACL编号 {in | out }可删除ACL

Router(config-if)#ip access-group ACL编号 {in | out }

11.3 命名式标准ACL配置命令

1、创建名为xxxx的标准ACL

Router(config)#ip access-list standard xxxx

2、编写ACL规则

Router(config-std-nacl)#permit/deny 1.1.1.0 0.0.0.255

3、在命名式标准ACL视图下编写注释

Router(config-std-nacl)#remark zhushi

4、在相应接口下调用标准式ACL

Router(config)#int g0/0/1
Router(config-if)#ip access-group xxxx in/out

11.4 命名式扩展ACL配置命令

1、创建名为xxxx的扩展ACL

Router(config)#ip access-list extended xxxx

2、编写ACL规则

Router(config-ext-nacl)#permit/deny 源地址 通配符 目的地址 通配符 eq 协议端口号

3、在命名式扩展ACL视图下编写注释

Router(config-ext-nacl)#remark zhushi

4、.在相应接口下调用扩展式ACL

Router(config)#int g0/0/1
Router(config-if)#ip access-group xxxx in/out

11.5 检查命令

1、使用show access-lists显示所有列表。

Router#show access-lists

2、使用show ip int g0/0/1命令查看Outgoing access list和Inbound access list有没有被调用ACL。

Router#show ip int g0/0/1

十二、PPP配置命令

12.1 PPP(PAP)单向认证配置命令

1、认证方 (1)设置用户名-被认证方和密码

R3(config)#username R2 password cisco

(2)串口视图下设置IP地址、封装协议PPP以及认证协议为PAP

R3(config)#int s0/2/0
R3(config-if)#ip add 1.1.1.2 255.255.255.0
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication pap 
R3(config-if)#no shutdown

2、被认证方 (1)串口视图下设置IP地址、封装协议PPP以及发送本端用户名及密码

R2(config)#int s0/2/0
R2(config-if)#ip add 1.1.1.1 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp pap sent-username R2 password cisco 
R2(config-if)#no shutdown

注意事项:PPP单向认证时,端口只有一边UP。

12.2 PPP(PAP)双向认证配置命令

1、认证方 (1)设置用户名-被认证方和密码

R3(config)#username R2 password cisco

(2)串口视图下设置IP地址、封装协议PPP、认证协议为PAP以及作为被认证方发送本端用户名及密码

R3(config)#int s0/2/0
R3(config-if)#ip add 1.1.1.2 255.255.255.0
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication pap 
R3(config-if)#no shutdown
R3(config-if)#ppp pap sent-username R3 password cisco 
R3(config-if)#shutdown
R3(config-if)#no shutdown

2、被认证方 (1)串口视图下设置IP地址、封装协议PPP、发送本端用户名及密码以及作为认证方时设置认证协议为PAP

R2(config)#int s0/2/0
R2(config-if)#ip add 1.1.1.1 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp pap sent-username R2 password cisco 
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#username R3 password cisco
R2(config)#int s0/2/0
R2(config-if)#ppp authentication pap 
R2(config-if)#shutdown
R2(config-if)#no shutdown

12.3 PPP(CHAP)单向认证配置命令

1、认证方 (1)设置用户名-被认证方和密码

R3(config)#username R2 password cisco

(2)串口视图下设置IP地址、封装协议PPP以及认证协议为CHAP

R3(config)#int s0/2/0
R3(config-if)#ip add 1.1.1.2 255.255.255.0
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication chap 
R3(config-if)#no shutdown

2、被认证方 (1)串口视图下设置IP地址、封装协议PPP以及发送本端用户名及密码

R2(config)#int s0/2/0
R2(config-if)#ip add 1.1.1.1 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp chap hostname R2 
R2(config-if)#ppp chap password cisco 
R2(config-if)#no shutdown

12.4 PPP(CHAP)双向认证配置命令

1、认证方 (1)设置用户名-被认证方和密码

R3(config)#username R2 password cisco

(2)串口视图下设置IP地址、封装协议PPP、认证协议为CHAP以及作为被认证方发送本端用户名及密码

R3(config)#int s0/2/0
R3(config-if)#ip add 1.1.1.2 255.255.255.0
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication chap 
R3(config-if)#no shutdown
R3(config-if)#ppp chap hostname R3 
R3(config-if)#ppp chap password cisco
R3(config-if)#shutdown
R3(config-if)#no shutdown

2、被认证方 (1)串口视图下设置IP地址、封装协议PPP、发送本端用户名及密码以及作为认证方时设置认证协议为PAP

R2(config)#int s0/2/0
R2(config-if)#ip add 1.1.1.1 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp chap hostname R2 
R2(config-if)#ppp chap password cisco 
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#username R3 password cisco
R2(config)#int s0/2/0
R2(config-if)#ppp authentication chap 
R2(config-if)#shutdown
R2(config-if)#no shutdown

十三、IPv6基础配置

13.1 IPv6地址配置

1、启动IPv6流量转发

Router(config)#ipv6 unicast-routing

2、配置接口IPv6地址

Router(config-if)#ipv6 address 2000::/64 eui-64 
Router(config-if)#ipv6 address 2000::1/64

13.2 IPv6域名解析配置

1、为IPv6地址定义静态名称

Router(config)#ipv6 host host_name [port] IPv6地址

2、配置一台或多台DNS服务器提供查询

Router(config)#ip name-server IPv6地址/IPv4地址

13.3 IPv6静态路由配置

1、静态路由配置

Router(config)#ipv6 route 2001::1/64 2001::2

2、静态缺省路由配置

Router(config)#ipv6 route ::/0 2001::2

13.4 RIPng配置

1、创建并进入RIP路由器配置模式

Router(config)#ipv6 router rip tag 

2、在接口上配置RIP

Router(config-rtr)#int g0/0/1
Router(config-if)#ipv6 rip tag enable

3、显示各种RIP进程的状态

Router#show ipv6 rip

4、显示IPv6路由表中的RIP路由

Router#show ipv6 route rip

13.5 IPv6ACL配置

1、创建扩展访问列表

Router(config)#ipv6 access-list example 

2、编写规则语句

Router(config-ipv6-acl)#{permit | deny} 协议 IPv6源地址 IPv6目的地址 eq 端口号

Router(config-ipv6-acl)#permit tcp 2001::1/64 2002::2/64 eq 23

3、在接口上调用ACL语句

Router(config-if)#ipv6 traffic-filter example {in | out}

十四、路由器配置PPPoE Client连接Internet

1、路由器上配置DHCP地址池,并配置网关、发布地址段、导入通过ipcp获取的dns等信息。

Router(config)#ip dhcp pool pool_1
Router(dhcp-config)#network 10.0.0.0 255.0.0.0(发布地址段)
Router(dhcp-config)#default-router 10.0.0.1(配置网关)
Router(dhcp-config)#import all(导入通过ipcp获取的dns等信息)

2、路由器上连接内网接口上配置IP地址并标记为连接内部网络的接口。

Router(config)#int g0/0/0
Router(config-if)#ip address 10.0.0.1 255.255.255.0 
Router(config-if)#ip nat inside (标记为连接内部网络的接口)

3、路由器上连接光猫的接口(外网物理连接接口)启动PPPoE以及以太口PPPoE客户端。

Router(config-if)#no ip address
Router(config-if)#pppoe enable(启动PPPoE)
Router(config-if)#pppoe-client dial-pool-number 1 启动以太口PPPoE客户端

4、路由器上创建PPPoE虚拟拨号接口,配置通过PPP协商动态获取地址、封装协议为PPP、与PPPoE物理接口绑定、优化PPPoE通信的MTU、标记为连接外部网络的接口、配置运营商分配的宽带用户名和密码。

Router(config)#interface Dialer 0(创建虚拟拨号接口NAT外网接口)
Router(config-if)#ip address negotiated (PPP协商动态获取地址)
Router(config-if)#encapsulation ppp(封装协议为PPP)
Router(config-if)#dialer pool 1(与PPPoE物理接口绑定)
Router(config-if)#ip mtu 1492(优化PPPoE通信的MTU)
Router(config-if)#ip nat outside(标记为连接外部网络的接口)
Router(config-if)#ppp chap hostname www(配置运营商分配的宽带用户名)
Router(config-if)#ppp chap password cisco(配置运营商分配的宽带密码)

5、定义允许那些需要转换的内部本地地址的标准IP ACL

Router(config)#access-list 1 permit 10.0.0.0 通配符

6、建立动态源转换,指定上一步定义的ACL

Router(config)#ip nat inside source list 1 interface Dialer0  overload

7、配置去往外网的默认静态路由

Router(config)#ip route 0.0.0.0 0.0.0.0 Dialer 0

十五、NAT配置命令

15.1 静态源地址转换配置命令

1、建立内部本地地址与内部全局地址间的静态转换。

Router(config)#ip nat inside source static 本地地址 全局地址

2、将该接口标记为连接内部网络的接口。

Router(config-if)#ip nat inside 

3、将该接口标记为连接外部网络的接口。

Router(config-if)#ip nat outside

4、显示活动的转换。

Router#show ip nat translations

15.2 动态源地址转换配置命令

1、定义可根据需要进行分配的全局地址池

Router(config)#ip nat pool pool_1 起始IP 终止IP netmask 255.255.255.0

2、定义允许那些需要转换的内部本地地址的标准IP ACL

Router(config)#access-list 1 permit 1.1.1.1 通配符

3、建立动态源转换,指定上一步定义的ACL

Router(config)#ip nat inside source list 1 pool pool_1

15.3 PAT配置命令

1、定义允许那些需要转换的内部本地地址的标准IP ACL

Router(config)#access-list 1 permit 1.1.1.1 通配符

2、建立动态源转换,指定上一步定义的ACL

Router(config)#ip nat inside source list 1 interface gigabitEthernet 0/0/1 overload

3、显示活动的转换。

Router#show ip nat translations

15.4 清除NAT缓存条目配置命令

1、清除动态NAT的转换条目,释放路由器内存

Router#clear ip nat translation * 

2、清除包含内部转换或同时包含内部转换与外部转换的简单动态转换条目。

Router#clear ip nat translation inside 全局地址 本地地址

3、清除包含外部的简单动态转换条目

Router#clear ip nat translation outside 全局地址 本地地址

4、清除扩展动态转换条目(PAT条目)

Router#clear ip nat translation protocol inside 全局地址  全局地址端口号 本地地址 本地地址端口号