当前位置:网站首页>交换机和路由器技术-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
边栏推荐
- Overview of the JVM garbage collection and mechanism
- 【服务器安装Redis】Centos7离线安装redis
- 我的LaTeX入门
- map and set - natural search and lookup semantics
- FPGA工程师面试试题集锦121~130
- 梅克尔工作室--OpenEuler培训笔记(1)
- The sword refers to offer_abstract modeling capabilities
- redis按照正则批量删除key
- LeetCode814 Math Question Day 15 Binary Tree Series Value "814 Binary Tree Pruning"
- The principle, architecture, implementation, practice of "transfer" and "search", no need to be afraid of interviews
猜你喜欢
What is Machine Reinforcement Learning?What is the principle?
I wrote some code in my resume, but I still can't pass the interview
Read the article, high-performance and predictable data center network
"104 Maximum Depth of Binary Trees" in LeetCode's Day 12 Binary Tree Series
无线电射频能量的收集
简历里写了会代码,却依然过不了面试这一关
The principle, architecture, implementation, practice of "transfer" and "search", no need to be afraid of interviews
Clang Code Model: Error: The clangbackend executable “X:/clangbackend.exe“ could not be started
【yolov7系列三】实战从0构建训练自己的数据集
Self-research capability was recognized again, and Tencent Cloud Database was included in the Forrester Translytical report
随机推荐
Clang Code Model: Error: The clangbackend executable “X:/clangbackend.exe“ could not be started
findViewById返回null的问题
Object Creation and Display Transformation
快速使用UE4制作”大场景游戏“
"98 BST and Its Verification" of the 13th day of leetcode brushing series of binary tree series
洛谷P1763 埃及分数
Introduction to c # a week of high-level programming c # - LINQ Day Four
洛谷P4061 大吉大利,晚上吃鸡
Get Qt installation information: including installation directory and various macro addresses
Mysql中事件和定时任务
The basics of binary heap~
蹭个热度-请勿打开
洛谷P2245 星际导航
【服务器安装Redis】Centos7离线安装redis
洛谷P1196 银河英雄传说
剑指offer_抽象建模能力
LeetCode Brush Questions Day 11 String Series "58 Last Word Length"
如何缓解压力、拒绝内耗【1】
网络安全培训机构哪家好?排名怎么选择?
拼多多店铺营业执照相关问题