当前位置:网站首页>交换机和路由器技术-34-动态NAT
交换机和路由器技术-34-动态NAT
2022-08-11 04:44:00 【w辣条小王子】
动态NAT
静态NAT 回顾
静态NAT 1—>1转 192.168.1.1----->64.23.54.99
命令:
在接口上定义内网和外网接口
Router(config)#int g0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config-if)#in nat inside source static内部ip 公网ip
查看转换表:
Show ip nat translations
做这个实验外网主机不需要配置网关,配置网关就是路由寻址而不是静态转换

动态NAT
动态的,多对多
第一步,完成拓扑搭建,划分网段,为PC配置IP地址,注意PC3不用配网关

第二步:在出口路由器上定义内网接口和外网接口
Router(config)#int g0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#
第三步:
1.定义内网的范围 使用ACL来定义允许
Router(config)#access-list 10 permit 192.168.10.0 0.0.0.255
2. 定义外网的范围,使用名称指定范围IP
Router(config)#ip nat pool dtnat 23.34.56.70 23.34.56.71 netmask 255.255.255.0
3.应用
Router(config)#ip nat inside source list 10 pool dtnat
三个内部地址对应两个公网地址,最多只能同时两个设备可以使用外网

查看转换表

清除转换表
Router#Clear ip nat translations *

出口路由器的配置
Router(config)#
Router(config)#int g0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#ip nat inside ?
source Source address translation
Router(config)#ip nat inside source ?
list Specify access list describing local addresses
static Specify static local->global mapping
Router(config)#ip nat inside source list ?
<1-199> Access list number for local addresses
WORD Access list name for local addresses
第一步:
创建ACL 允许192.168.10.0 网段通过,注意ACL使用的是反掩码
Router(config)#access-list 10 permit ?
A.B.C.D Address to match
any Any source host
host A single host address
Router(config)#access-list 10 permit 192.168.10.0 ?
A.B.C.D Wildcard bits
<cr>
Router(config)#access-list 10 permit 192.168.10.0 0.0.0.255
第二步:
创建Pool定义公网地址范围,注意要加上子网掩码确定网络范围大小
Router(config)#ip nat ?
inside Inside address translation
outside Outside address translation
pool Define pool of addresses
Router(config)#ip nat pool nat ?
A.B.C.D Start IP address
Router(config)#ip nat pool nat 23.34.56.70 ?
A.B.C.D End IP address
Router(config)#ip nat pool nat 23.34.56.70 23.34.56.71
% Incomplete command.
Router(config)#ip nat pool nat 23.34.56.70 23.34.56.71 ?
netmask Specify the network mask
Router(config)#ip nat pool nat 23.34.56.70 23.34.56.71 netmask 255.255.255.0
应用:
Router(config)#ip nat inside source ?
list Specify access list describing local addresses
static Specify static local->global mapping
Router(config)#ip nat inside source list 10 ?
interface Specify interface for global address
pool Name pool of global addresses
Router(config)#ip nat inside source list 10 pool nat
边栏推荐
- How to learn machine learning?machine learning process
- 洛谷P6586 蒟蒻火锅的盛宴
- 1815. Get the maximum number of groups of fresh donuts state compression
- 洛谷P2245 星际导航
- 洛谷P4560 Wall 砖墙
- 澳大利亚网络空间安全体系建设论析
- 一文读懂 高性能可预期数据中心网络
- 破解事务性工作瓶颈,君子签电子合同释放HR“源动力”!
- 洛谷P2370 yyy2015c01 的 U 盘
- Alibaba Cloud releases 3 high-performance computing solutions
猜你喜欢

Overview of the JVM garbage collection and mechanism

获取Qt的安装信息:包括安装目录及各种宏地址

Apache初体验

【人话版】WEB3将至之“权益的游戏”

Read the article, high-performance and predictable data center network

ALSA音频架构

Embedded Sharing Collection 33

延长经济保险(jeecgboot)

"104 Maximum Depth of Binary Trees" in LeetCode's Day 12 Binary Tree Series

分层架构&SOA架构
随机推荐
ALSA音频架构 -- aplay播放流程分析
洛谷P4847 银河英雄传说V2
使用百度EasyDL实现施工人员安全装备检测
【Web3 系列开发教程——创建你的第一个 NFT(9)】如何在手机钱包里查看你的 NFT
Provincial level of Echart maps, as well as all prefecture-level download and use
《卫星界》刊评“星辰大海”计划:孙宇晨为太空旅游带来新的机遇
Clang Code Model: Error: The clangbackend executable “X:/clangbackend.exe“ could not be started
Jetson Orin平台4-16路 GMSL2/GSML1相机采集套件推荐
【深度学习】基于卷积神经网络的天气识别训练
[Server installation mysql] Use mysql offline installation package to install mysql5.7 under centos7
分层架构&SOA架构
.NET Custom Middleware
What is ensemble learning in machine learning?
Selenium自动化测试框架工作原理你明白了吗?
jwsManager服务接口实现类-jni实现
关于数据分页显示
Listen to pull out U disk inserted into the message, U disk drive
set_new_handler(0)是什么意思?有什么用?
Snap - rotate the smallest number of an array
JwsManager service interface implementation class - the jni implementation