当前位置:网站首页>静态路由+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访问验证:
验证成功!!!!
边栏推荐
- Multiplication, DFS order
- 太阳能板最大面积 od js
- 软件测试工作3年了,谈谈我是如何从刚入门进阶到自动化测试的?
- How to expose Prometheus metrics in go programs
- leetcode-128:最长连续序列
- "Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
- ROS Action communication
- 934. The Shortest Bridge
- Is there a way to earn 300 yuan a day by doing a side business?
- MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法
猜你喜欢
MySQL的分页你还在使劲的limit?
[WeChat applet] This article takes you to understand data binding, event binding, event parameter transfer, and data synchronization
Chi-square distribution of digital image steganography
What have I experienced when I won the offer of BAT and TMD technical experts?
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
两个有序数组间相加和的Topk问题
勾股数元组 od js
Basic Parameters of RF Devices 1
Interprocess communication study notes
基于FPGA的售货机
随机推荐
VSCode插件:嵌套注释
Simple confession page
C language applet -- common classic practice questions
221. 最大正方形
斩获BAT、TMD技术专家Offer,我都经历了什么?
The Meta Metaverse Division lost 2.8 billion in the second quarter, still want to continue to bet?Metaverse development has yet to see a way out
Inner monologue from a female test engineer...
Bert usage and word prediction based on Keras_bert model
[WeChat applet] This article takes you to understand data binding, event binding, event parameter transfer, and data synchronization
The PC side determines the type of browser currently in use
PDF split/merge
Jiuzhou Cloud was selected into the "Trusted Cloud's Latest Evaluation System and the List of Enterprises Passing the Evaluation in 2022"
Set the browser scrollbar style
VSCode Plugin: Nested Comments
Path and the largest
软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具
ROS Action communication
关于Redis相关内容的基础学习
最大路径和
MySql installation and configuration super detailed tutorial and simple method of building database and table