笔记-CCNA与网络安全 第9章 NAT和PAT

NAT(Network Address Translation)的类型

私用地址和公用地址一一对应,不节省地址


静态NAT

配置静态NAT

Router(config)#ip nat <inside/outside> source static <原IP> <转换IP>    //设置NAT是从内向外(或从外向内)的地址转换IP对应关系
……………………
Router(config-if)#ip nat inside  //设置内网接口
………………
Router(config-if)#ip nat outside  //设置外网接口
主要是2个步骤:1.配置静态映射 2.指定NAT的内网和外网


在路由器上显示NAT信息

Router#debug ip nat


显示数据包转发信息

Router#debug ip packet


取消debug

Router#un all   


动态NAT

配置动态NAT

Router(config)#access-list <ACL编号1-99> permit <ip地址段> <子网掩码反码>  //需先定义ACL
Router(config)#ip nat pool <密码> <公网地址集合首IP地址> <公网地址集合尾IP地址> netmask <子网掩码>  //配置公网地址池
Router(config)#ip nat inside source list <前面定义的ACL编号> pool <密码>
Router(config-if)#ip nat <inside/outside>  //配置内外网接口
例:
Router(config)#access-list 10 permit 10.0.0.0 0.0.0.255
Router(config)#ip nat pool todd 131.107.0.1 131.107.0.3 netmask 255.255.255.0
Router(config)#ip nat inside source list 10 pool todd
…………
Router(config-if)#ip nat inside
……
Router(config-if)#ip nat outside
当地址池内的地址用完后,其余计算机无法再获得转换地址


PAT(端口地址转换 Port Address Translation)

配置PAT

第一种方法:

Router(config)#access-list <ACL编号1-99> permit <ip地址段> <子网掩码反码>  //需先定义ACL
Router(config)#ip nat pool <密码> <公网地址集合首IP地址> <公网地址集合尾IP地址> netmask <子网掩码>  //配置公网地址,只要设置集合的IP地址相同即可
Router(config)#ip nat inside source list <前面定义的ACL编号> pool <密码> overload
Router(config-if)#ip nat <inside/outside>  //配置内外网接口
例:
Router(config)#access-list 10 permit 10.0.0.0 0.0.0.255
Router(config)#ip nat pool todd 131.107.0.1 131.107.0.1 netmask 255.255.255.0
Router(config)#ip nat inside source list 10 pool todd overload
…………
Router(config-if)#ip nat inside
……
Router(config-if)#ip nat outside

第二种方法

Router(config)#access-list <ACL编号1-99> permit <ip地址段> <子网掩码反码>  //需先定义ACL
Router(config)#ip nat inside source list <上面ACL编号> interface <接口> overload  //实现外接口地址的复用及IP地址的动态转换
Router(config-if)#ip nat <inside/outside>  //配置内外网接口
例:
Router(config)#access-list 10 permit 10.0.0.0 0.0.0.255
Router(config)#ip nat inside source list 10 interface fastEthernet 0/1
…………
Router(config-if)#ip nat inside
……
Router(config-if)#ip nat outside


静态端口映射

Router(config)#ip nat inside source <协议> <内网地址> <端口号> <外网地址> <端口号>  //定义端口映射关系
……
Router(config-if)#ip nat <inside/outside>  //设置端口属于内网还是外网
例:
Router(config)#ip nat inside source tcp 10.0.0.6 80 131.107.0.1 80 //定义端口映射关系
……
Router(config-if)#ip nat inside
……
Router(config-if)#ip nat outside
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
实验报告包含详细的实验截图和命令 Task 1: Configure Local AAA Authentication for Console Access on R1 Step 1. Test connectivity. · Ping from PC-A to PC-B. · Ping from PC-A to PC-C. · Ping from PC-B to PC-C. Step 2. Configure a local username on R1. Configure a username of Admin1 and secret password of admin1pa55. Step 3. Configure local AAA authentication for console access on R1. nable AAA on R1 and configure AAA authentication for console login to use the local database. Step 4. Configure the line console to use the defined AAA authentication method. Enable AAA on R1 and configure AAA authentication for console login to use the default method list. Step 5. Verify the AAA authentication method. Verify the user EXEC login using the local database. Task 2: Configure Local AAA Authentication for VTY Lines on R1 Step 1. Configure a named list AAA authentication method for VTY lines on R1. Configure a named list called TELNET-LOGIN to authenticate logins using local AAA. Step 2. Configure the VTY lines to use the defined AAA authentication method. Configure the VTY lines to use the named AAA method. Step 3. Verify the AAA authentication method. Verify the Telnet configuration. From the command prompt of PC-A, Telnet to R1. Task 3: Configure Server-Based AAA Authentication Using TACACS+ on R2 Step 1. Configure a backup local database entry called Admin. For backup purposes, configure a local username of Admin and secret password of adminpa55. Step 2. Verify the TACACS+ Server configuration. Select the TACACS+ Server. From the Config tab, click on AAA and notice that there is a Network configuration entry for R2 and a User Setup entry for Admin2. Step 3. Configure the TACACS+ server specifics on R2. Configure the AAA TACACS server IP address and secret key on R2. Step 4. Configure AAA login authentication for console access on R2. Enable AAA on R2 and configure all logins to authenticate using the AAA TACACS+ server and if not available, then use the local database. Step 5. Configure the line console to use the defined AAA authentication method. Configure AAA authentication for console login to use the default AAA authentication method. Step 6. Verify the AAA authentication method. Verify the user EXEC login using the AAA TACACS+ server. Task 4: Configure Server-Based AAA Authentication Using RADIUS on R3 Step 1. Configure a backup local database entry called Admin. For backup purposes, configure a local username of Admin and secret password of adminpa55. Step 2. Verify the RADIUS Server configuration. Select the RADIUS Server. From the Config tab, click on AAA and notice that there is a Network configuration entry for R3 and a User Setup entry for Admin3. Step 3. Configure the RADIUS server specifics on R3. Configure the AAA RADIUS server IP address and secret key on R3. Step 4. Configure AAA login authentication for console access on R3. Enable AAA on R3 and configure all logins to authenticate using the AAA RADIUS server and if not available, then use the local database. Step 5. Configure the line console to use the defined AAA authentication method. Configure AAA authentication for console login to use the default AAA authentication method. Step 6. Verify the AAA authentication method. Verify the user EXEC login using the AAA TACACS+ server. Step 7. Check results.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值