Home Database Mysql Tutorial CISCO NAT 配置

CISCO NAT 配置

Jun 07, 2016 pm 03:06 PM
cisco internet nat network fast Configuration along with

随着internet的网络迅速发展,IP地址短缺已成为一个十分突出的问题。为了解决这个问题,出现了多种解决方案。下面几绍一种在目前网络环境中比较有效的方法即地址转换(NAT)功能。 一、NAT简介 NAT(Network Address Translation)的功能,就是指在一个网络内部

随着internet的网络迅速发展,IP地址短缺已成为一个十分突出的问题。为了解决这个问题,出现了多种解决方案。下面几绍一种在目前网络环境中比较有效的方法即地址转换(NAT)功能。
一、NAT简介
  NAT(Network Address Translation)的功能,就是指在一个网络内部,根据需要可以随意自定义的IP地址,而不需要经过申请。在网络内部,各计算机间通过内部的IP地址进行通讯。而当内部的计算机要与外部internet网络进行通讯时,具有NAT功能的设备(比如:路由器)负责将其内部的IP地址转换为合法的IP地址(即经过申请的IP地址)进行通信。

二、NAT 的应用环境:

  情况1:
   一个企业不想让外部网络用户知道自己的网络内部结构,可以通过NAT将内部网络与外部Internet 隔离开,则外部用户根本不知道通过NAT设置的内部IP地址。

  情况2:
   一个企业申请的合法Internet IP地址很少,而内部网络用户很多。可以通过NAT功能实现多个用户同时公用一个合法IP与外部Internet 进行通信。

三、设置NAT所需路由器的硬件配置和软件配置

  设置NAT功能的路由器至少要有一个内部端口(Inside),一个外部端口(Outside)。内部端口连接的网络用户使用的是内部IP地址。

  内部端口可以为任意一个路由器端口。外部端口连接的是外部的网络,如Internet 。外部端口可以为路由器上的任意端口。

  设置NAT功能的路由器的IOS应支持NAT功能(本文事例所用路由器为Cisco2501,其IOS为11.2版本以上支持NAT功能)。

四、关于NAT的几个概念:

  内部本地地址(Inside local address):分配给内部网络中的计算机的内部IP地址。

  内部合法地址(Inside global address):对外进入IP通信时,代表一个或多个内部本地地址的合法IP地址。需要申请才可取得的IP地址。

五、NAT的设置方法:

  NAT设置可以分为静态地址转换、动态地址转换、复用动态地址转换。

  1、静态地址转换适用的环境

静态地址转换将内部本地地址与内部合法地址进行一对一的转换,且需要指定和哪个合法地址进行转换。如果内部网络有E-mail服务器或FTP服务器等可以为外部用户提供的服务,这些服务器的IP地址必须采用静态地址转换,以便外部用户可以使用这些服务。

静态地址转换基本配置步骤:

在内部本地地址与内部合法地址之间建立静态地址转换。在全局设置状态下输入:
Ip nat inside source static 内部本地地址 内部合法地址


指定连接网络的内部端口 在端口设置状态下输入:
ip nat inside


指定连接外部网络的外部端口 在端口设置状态下输入:
ip nat outside

注:可以根据实际需要定义多个内部端口及多个外部端口。

实例1:
本实例实现静态NAT地址转换功能。将2501的以太口作为内部端口,同步端口0作为外部端口。其中10.1.1.2,10.1.1.3,10.1.1.4的内部本地地址采用静态地址转换。其内部合法地址分别对应为192.1.1.2,192.1.1.3,192.1.1.4。

路由器2501的配置
Current configuration:

version 11.3

no service password-encryption

hostname 2501

ip nat inside source static 10.1.1.2 192.1.1.2

ip nat inside source static 10.1.1.3 192.1.1.3

ip nat inside source static 10.1.1.4 192.1.1.4

interface Ethernet0

ip address 10.1.1.1 255.255.255.0

ip nat inside

interface Serial0

ip address 192.1.1.1 255.255.255.0

ip nat outside

no ip mroute-cache

bandwidth 2000

no fair-queue

clockrate 2000000

interface Serial1

no ip address

shutdown

no ip classless

ip route 0.0.0.0 0.0.0.0 Serial0

line con 0

line aux 0

line vty 0 4

password cisco

end

配置完成后可以用以下语句进行查看:

show ip nat statistcs
show ip nat translations

  2、动态地址转换适用的环境:

动态地址转换也是将本地地址与内部合法地址一对一的转换,但是动态地址转换是从内部合法地址池中动态地选择一个末使用的地址对内部本地地址进行转换。

动态地址转换基本配置步骤:

在全局设置模式下,定义内部合法地址池
ip nat pool 地址池名称 起始IP地址 终止IP地址 子网掩码
其中地址池名称可以任意设定。


在全局设置模式下,定义一个标准的access-list规则以允许哪些内部地址可以进行动态地址转换。
Access-list 标号 permit 源地址 通配符
其中标号为1-99之间的整数。


在全局设置模式下,将由access-list指定的内部本地地址与指定的内部合法地址池进行地址转换。
ip nat inside source list 访问列表标号 pool内部合法地址池名字


指定与内部网络相连的内部端口在端口设置状态下:
ip nat inside


指定与外部网络相连的外部端口
Ip nat outside
实例2:
本实例中硬件配置同上,运用了动态NAT地址转换功能。将2501的以太口作为内部端口,同步端口0作为外部端口。其中10.1.1.0网段采用动态地址转换。对应内部合法地址为192.1.1.2~192.1.1.10

Current configuration:

version 11.3

no service password-encryption

hostname 2501

ip nat pool aaa 192.1.1.2 192.1.1.10 netmask 255.255.255.0

ip nat inside source list 1 pool aaa

interface Ethernet0

ip address 10.1.1.1 255.255.255.0

ip nat inside

interface Serial0

ip address 192.1.1.1 255.255.255.0

ip nat outside

no ip mroute-cache

bandwidth 2000

no fair-queue

clockrate 2000000

interface Serial1

no ip address

shutdown

no ip classless

ip route 0.0.0.0 0.0.0.0 Serial0

access-list 1 permit 10.1.1.0 0.0.0.255

line con 0

line aux 0

line vty 0 4

password cisco

end

  3、复用动态地址转换适用的环境:

复用动态地址转换首先是一种动态地址转换,但是它可以允许多个内部本地地址共用一个内部合法地址。只申请到少量IP地址但却经常同时有多于合法地址个数的用户上外部网络的情况,这种转换极为有用。

注意:当多个用户同时使用一个IP地址,外部网络通过路由器内部利用上层的如TCP或UDP端口号等唯一标识某台计算机。 

复用动态地址转换配置步骤:

在全局设置模式下,定义内部合地址池

ip nat pool 地址池名字 起始IP地址 终止IP地址 子网掩码
其中地址池名字可以任意设定。


在全局设置模式下,定义一个标准的access-list规则以允许哪些内部本地地址可以进行动态地址转换。

access-list 标号 permit 源地址 通配符
其中标号为1-99之间的整数。


在全局设置模式下,设置在内部的本地地址与内部合法IP地址间建立复用动态地址转换。
ip nat inside source list 访问列表标号 pool 内部合法地址池名字 overload


在端口设置状态下,指定与内部网络相连的内部端口
ip nat inside


在端口设置状态下,指定与外部网络相连的外部端口
ip nat outside
实例:3

应用了复用动态NAT地址转换功能。将2501的以太口作为内部端口,同步端口0作为外部端口。10.1.1.0网段采用复用动态地址转换。假设企业只申请了一个合法的IP地址192.1.1.1。

2501的配置

Current configuration:

version 11.3

no service password-encryption

hostname 2501

ip nat pool bbb 192.1.1.1 192.1.1.1 netmask 255.255.255.0

ip nat inside source list 1 pool bbb overload

interface Ethernet0

ip address 10.1.1.1 255.255.255.0

ip nat inside

interface Serial0

ip address 192.1.1.1 255.255.255.0

ip nat outside

no ip mroute-cache

bandwidth 2000

no fair-queue

clockrate 2000000

interface Serial1

no ip address

shutdown

no ip classless

ip route 0.0.0.0 0.0.0.0 Serial0

access-list 1 permit 10.1.1.0 0.0.0.255

line con 0

line aux 0

line vty 0 4

password cisco

end




Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if the earth is displayed in the lower right corner of Windows 10 when I cannot access the Internet? Various solutions to the problem that the Earth cannot access the Internet in Win10 What should I do if the earth is displayed in the lower right corner of Windows 10 when I cannot access the Internet? Various solutions to the problem that the Earth cannot access the Internet in Win10 Feb 29, 2024 am 09:52 AM

This article will introduce the solution to the problem that the globe symbol is displayed on the Win10 system network but cannot access the Internet. The article will provide detailed steps to help readers solve the problem of Win10 network showing that the earth cannot access the Internet. Method 1: Restart directly. First check whether the network cable is not plugged in properly and whether the broadband is in arrears. The router or optical modem may be stuck. In this case, you need to restart the router or optical modem. If there are no important things being done on the computer, you can restart the computer directly. Most minor problems can be quickly solved by restarting the computer. If it is determined that the broadband is not in arrears and the network is normal, that is another matter. Method 2: 1. Press the [Win] key, or click [Start Menu] in the lower left corner. In the menu item that opens, click the gear icon above the power button. This is [Settings].

The working principle and configuration method of GDM in Linux system The working principle and configuration method of GDM in Linux system Mar 01, 2024 pm 06:36 PM

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

The perfect combination of PyCharm and PyTorch: detailed installation and configuration steps The perfect combination of PyCharm and PyTorch: detailed installation and configuration steps Feb 21, 2024 pm 12:00 PM

PyCharm is a powerful integrated development environment (IDE), and PyTorch is a popular open source framework in the field of deep learning. In the field of machine learning and deep learning, using PyCharm and PyTorch for development can greatly improve development efficiency and code quality. This article will introduce in detail how to install and configure PyTorch in PyCharm, and attach specific code examples to help readers better utilize the powerful functions of these two. Step 1: Install PyCharm and Python

What's going on when the network can't connect to the wifi? What's going on when the network can't connect to the wifi? Apr 03, 2024 pm 12:11 PM

1. Check the wifi password: Make sure the wifi password you entered is correct and pay attention to case sensitivity. 2. Confirm whether the wifi is working properly: Check whether the wifi router is running normally. You can connect other devices to the same router to determine whether the problem lies with the device. 3. Restart the device and router: Sometimes, there is a malfunction or network problem with the device or router, and restarting the device and router may solve the problem. 4. Check the device settings: Make sure the wireless function of the device is turned on and the wifi function is not disabled.

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

Windows 11 Folder Sharing Guide: Easily Share Your Files and Data Windows 11 Folder Sharing Guide: Easily Share Your Files and Data Mar 13, 2024 am 11:49 AM

In daily life and work, we often need to share files and folders between different devices. Windows 11 system provides convenient built-in folder sharing functions, allowing us to easily and safely share the content we need with others within the same network while protecting the privacy of personal files. This feature makes file sharing simple and efficient without worrying about leaking private information. Through the folder sharing function of Windows 11 system, we can cooperate, communicate and collaborate more conveniently, improving work efficiency and life convenience. In order to successfully configure a shared folder, we first need to meet the following conditions: All devices (participating in sharing) are connected to the same network. Enable Network Discovery and configure sharing. Know the target device

How to configure workgroup in win11 system How to configure workgroup in win11 system Feb 22, 2024 pm 09:50 PM

How to configure a workgroup in Win11 A workgroup is a way to connect multiple computers in a local area network, which allows files, printers, and other resources to be shared between computers. In Win11 system, configuring a workgroup is very simple, just follow the steps below. Step 1: Open the "Settings" application. First, click the "Start" button of the Win11 system, and then select the "Settings" application in the pop-up menu. You can also use the shortcut "Win+I" to open "Settings". Step 2: Select "System" In the Settings app, you will see multiple options. Please click the "System" option to enter the system settings page. Step 3: Select "About" In the "System" settings page, you will see multiple sub-options. Please click

How to configure and install FTPS in Linux system How to configure and install FTPS in Linux system Mar 20, 2024 pm 02:03 PM

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

See all articles