Skip to content
Step by Step Internet 馃寪 Guides for learning to surf the Net

How to correctly configure a NAT network to improve the security of communication between different networks? Step by step guide

To properly configure a NAT network and improve the security of communication between networks You will have to know what this networking tool is for and what are the benefits it presents.

In the paragraphs of this article you can find the details of the advantages of using a NAT and why it is important to configure it correctly to protect the private data of your computer.

If you want to become a computer expert, you should read this post to the end because it also We will teach you the step by step to create and configure a NAT from scratch.

What is NAT and what is this tool for in networking?

NAT is network address translation, which is a way to map different local private addresses to one public address, before you start transferring the information. For example, if you want several devices to have a single IP address you will have to use NAT. This means that if you have a computer connected to the Internet you will have to send a request to the router to access a web, which will have to communicate with the page’s server.

Then you will have to receive the data and then deliver it to the computer. All this the team will do with a Public IP, so the outgoing IP address of the private premises becomes a public address that everyone will know. If you use NAT, the information will return to your computer using the public address of the router, that is, the private address of your PC will never be known.

What are the benefits of using a NAT network?

Use NAT It has many benefits, but it especially influences the privacy of the data of the device that connects to the web.

Also, when you use NAT you will be able to:

  • Re-use the directions Private IP.
  • Connect to multiple Internet servers global using a very low number of public IP addresses. This will conserve the IP address space.
  • You will keep the internal IP addressing in private networks with the external network providing more security to all participants.

Learn step by step how to create and configure a NAT network from scratch

The steps you will have to do to create a NAT from scratch are:

Activate PowerShell

Activate PowerShell

The first thing you will have to do is go down in your team PowerShell.

For this, you will have to follow these stages:

  • Sign in to the console and type Get-Host | Select-Object .
  • Check that the operating system has correctly configured the execution of scripts. You can do this if you click on Start, then on All the programs and finally in accessories. Next, you will have to click on Windows PowerShell and right click to choose the option Execute as an administrator.
  • Change the execution policy by typing Set-ExecutionPolicy RemoteSigned -Force.

Create the NAT network

For start a new NAT virtual network you must open the console PowerShell being administrator.

Then you must create a computer internally and run this command:

  • CODE: New-VMSwitch -SwitchName “SwitchName” -SwitchType Internal

Then, you will look for the interface index on the communicator that you recently created.

To speed up the process you can enter the command:

  • CODE: Get-NetAdapter

Everything you have created will have the name of vEthernet (SwitchName). Also, in the description of its interface you will see Hyper-V Virtual Ethernet Adapter. When you are done you must write ifIndex to continue to the next step.

Connect devices

Next, you need to configure the gateway NAT through New-NetIPAddress.

For this you will use the command:

  • CODE: New-NetIPAddress -IPAddress -PrefixLength -InterfaceIndex

Now, you will have to configure the gateways, for this you will need the network information.

We show you below the concepts that you will see:

  • PrefixLength: is the length over the NAT prefix which defines the local size over the subnet. The length on this subnet prefix has a value that varies between 0 and 32. One thing to keep in mind is that normal values ​​can be between 24 and 12.
  • IPAddress: is the NAT gateway address which will be specified over the address IPv4 or IPv6 (which is what is used as the port IP address). One gateway that everyone knows is 192.168.1.1.
  • InterfaceIndex: it is known as the index of the virtual switch which has already been defined before. For this, you have to execute the command to be able to create the NAT gateway CODE: New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 24.

Network settings

To start the configuration, execute the command:

  • CODE: New-NetNat -Name -InternalIPInterfaceAddressPrefix

This command includes:

  • InternalIPInterfaceAddressPrefix: It is known as the NAT prefix, which describes the gateway that has been achieved before, it is also known as the length of the prefix and the NAT subnet above.
  • Yam: describes the name of the network in which it is used to be able to remove the NAT network.

A well-known and generic format can be known as abc0 / length, which is the prefix on the NAT subnet. An example will be 192.168.0.0/24.