当前位置:网站首页>静态路由+PAT+静态NAT(讲解+实验)
静态路由+PAT+静态NAT(讲解+实验)
2022-07-31 01:48:00 【孤城286】
目录
一、静态路由详解:
涉及知识!!!:
(40条消息) 静态路由(实验讲解+配置)_孤城286的博客-CSDN博客_明细路由和静态路由
(41条消息) vlan间路由(讲解+验证)_孤城286的博客-CSDN博客
NAT (PAT)地址转换技术(讲解+配置)_孤城286的博客-CSDN博客_nat地址转换配置详解
注:静态缺省:S*开头,静态明细:C开头
——————————————————————————————————————————————————————————
二、PAT转换
简介:把内部地址映射到外部网络的一个IP地址的不同端口上。实现私网地址和公网地址的一对多转换。(基于源IP的转换)
—————————————————————————————————————————————————————————
三、实验(一)静态路由+PAT
模拟器:Cisco Packet Tracer
(1)实验拓扑:
(2)实验需求
- PC1和PC2能访问互联网上的PC3
(3)实验思路
- ①利用VLAN间路由把内网打通
- ②核心交换机(缺省路由)和R1配置路由(缺省+明细){ 核心交换机二层接口需转换为三层}
- ③再R1上做PAT地址转换
- ④验证(ping测试)
(4)实验配置:
- ①关于vlan间路由:
(40条消息) vlan间路由(讲解+验证)_孤城286的博客-CSDN博客
- ②核心交换机配置 路由配置:
sw1(config-if)#int f0/4
sw1(config-if)#no switchport ——二层接口变为三层配置IP
sw1(config-if)#ip add 172.16.1.2 255.255.255.0
Bad mask 0xFFFF3700 for address 172.16.1.2
sw1(config-if)#no sh
sw1(config)#exit
sw1(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.1
- ③R1配置:
R1(config)#interface f0/0
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#interface f0/1
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2
R1(config)#ip route 10.1.1.0 255.255.255.0 172.16.1.2
R1(config)#ip route 10.1.2.0 255.255.255.0 172.16.1.2
R1(config)#ip route 10.1.3.0 255.255.255.0 172.16.1.2
R1(config)#int f0/1
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#int f0/0
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#access-list 1 permit 10.1.1.0 0.0.0.255
R1(config)#access-list 1 permit 10.1.2.0 0.0.0.255
R1(config)#ip nat inside source list 1 int f0/1 overload
- ④R2配置:
R2(config)#int f0/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R1(config-if)#no sh
R2(config-if)#int f0/1
R2(config-if)#ip add 202.1.1.254 255.255.255.0
R2(config-if)#no sh
- ⑤实验验证:
访问成功!!!!!
(5)实验注意点
- ①核心交换机接口本身为二层接口,需要进入接口通过no switchport命令转换为三层接口
- ②核心交换机需要通过命令ip routing开启路由转发功能
- ③网络设备需观察接口是否激活(激活为绿色,未激活为红色)
——————————————————————————————————————————————————————————
四、实验(二)(新需求)——静态NAT转换
新需求:内网服务器需要对外网提供访问服务
此时需要把服务器的私有IP地址静态映射到一个公网IP地址上面去(一对一)
(1)R1配置:
R1(config)#ip nat inside source static ?
A.B.C.D Inside local IP address
tcp Transmission Control Protocol
udp User Datagram Protocol
R1(config)#ip nat inside source static tcp 10.1.3.1 80 12.1.1.1 80
R1(config)#ip route 10.1.3.0 255.255.255.0 172.16.1.2 ——原来没有配置R1去往服务器的路由
(2)验证:
服务器开启对应HTTP网页服务:
PC3访问验证:
验证成功!!!!
边栏推荐
- leetcode-1161:最大层内元素和
- Between two orderly array of additive and Topk problem
- I have been working in software testing for 3 years, how did I go from just getting started to automated testing?
- 一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例
- 勾股数元组 od js
- rpm install postgresql12
- 【flask入门系列】Flask-SQLAlchemy的使用
- leetcode-952:按公因数计算最大组件大小
- PDF 拆分/合并
- 两个有序数组间相加和的Topk问题
猜你喜欢
随机推荐
Arbitrum 专访 | L2 Summer, 脱颖而出的 Arbitrum 为开发者带来了什么?
[1154]如何将字符串转换为datetime
软件测试报告有哪些内容?
12张图带你彻底搞懂服务限流、熔断、降级、雪崩
MySQL (6)
C语言_结构体指针数组函数选票系统
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
曼城推出可检测情绪的智能围巾,把球迷给整迷惑了
VSCode Plugin: Nested Comments
ROS Action通信
软件测试要达到一个什么水平才能找到一份9K的工作?
Bert usage and word prediction based on Keras_bert model
keep-alive缓存组件
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
什么是理想的大学生活?
用户交互+格式化输出
Centos 7.9安装PostgreSQL14.4步骤
kotlin中函数作为参数和函数作为返回值实例练习
蛮力法/邻接表 广度优先 有向带权图 无向带权图
Arbitrum Interview | L2 Summer, what does the standout Arbitrum bring to developers?