Questions tagged [nat]

In computer networking, network address translation (NAT) is the process of modifying network address information in datagram (IP) packet headers while in transit across a traffic routing device for the purpose of remapping one IP address space into another.

Most often today, NAT is used in conjunction with network masquerading (or IP masquerading) which is a technique that hides an entire IP address space, usually consisting of private network IP addresses (RFC 1918), behind a single IP address in another, often public address space. This mechanism is implemented in a routing device that uses stateful translation tables to map the "hidden" addresses into a single IP address and readdresses the outgoing Internet Protocol (IP) packets on exit so that they appear to originate from the router. In the reverse communications path, responses are mapped back to the originating IP address using the rules ("state") stored in the translation tables. The translation table rules established in this fashion are flushed after a short period unless new traffic refreshes their state.

As described, the method enables communication through the router only when the conversation originates in the masqueraded network, since this establishes the translation tables. For example, a web browser in the masqueraded network can browse a website outside, but a web browser outside could not browse a web site in the masqueraded network. However, most NAT devices today allow the network administrator to configure translation table entries for permanent use. This feature is often referred to as "static NAT" or port forwarding and allows traffic originating in the "outside" network to reach designated hosts in the masqueraded network.

Because of the popularity of this technique (see below), the term NAT has become virtually synonymous with the method of IP masquerading.

Network address translation has serious drawbacks on the quality of Internet connectivity and requires careful attention to the details of its implementation. As a result, many methods have been devised to alleviate the issues encountered. See the article on NAT traversal.

2002 questions
12
votes
2 answers

Wireguard not completing handshake

I have two Debian GNU/Linux systems (bullseye/sid), both running wireguard on port 23456, both behind NAT. Both run a kernel version > 5.6 (wireguard mainlined). System A is the server, and it dynamically updates a dedicated "A record" in the…
Lucio Crusca
  • 420
  • 3
  • 12
  • 33
11
votes
1 answer

What ports should be mapped via NAT for Lync client?

I installed gateway with NAT between PC and network. User of PC can chat via Lync client but can't call or join conference. What ports should be mapped via NAT for Lync client to use all Lync facilities? Updated: the question actually is about NAT…
Parfen
  • 149
  • 1
  • 4
11
votes
2 answers

iptables: Port forwarding with masquerading is not working

I'm having some issues with my port forwards. NAT seems to work ok and one out of the port forwards seem to work (udp port 7887 to machine 192.168.1.100). But not the others. I doubt that it matters, but eth1 & eth2 are located on a dualport…
Robert Foss
  • 233
  • 1
  • 3
  • 11
11
votes
2 answers

Why is nat required when proxy is enough?

My machine is connected in a local lan. to connect to the internet the traffic goes through proxy server. my understanding of proxy server is that it sends the request on behalf of the original request sender. So when the server replies, it sends…
Ashwin
  • 307
  • 1
  • 4
  • 13
11
votes
1 answer

Basic iptables NAT port forwarding

I have three machines: A local PC (public IP 1.2.3.4), an Ubuntu 10 Server box in a datacentre (eth0 on 5.6.7.8 public IP), and a third-party server hosting a website outside of my network (let's say Slashdot on 216.34.181.45). Using iptables, how…
jetboy
  • 912
  • 2
  • 11
  • 25
10
votes
1 answer

Configuring 1:1 Nat using Firewalld for VM's

I've setup 2 vm's within my server and I'm trying to setup a 1:1 NAT for them with firewalld on CentOS 7. Currently both vm's are behind a virtual bridge (virbr0, vnet0, vnet1) and I've made copies of the NIC for each IP to be used with them. I…
dstana
  • 285
  • 2
  • 10
10
votes
4 answers

AWS VPC + IPtables + NAT: Port Forwarding is not working

Yesterday, I posted a question here but I think was not clear enough in my words. BTW, This question is not a duplicate. I have AWS VPC Setup as below. GOAL/PROBLEM: SSH to Server A from internet. And It is not working. Server A is in private…
slayedbylucifer
  • 504
  • 3
  • 7
  • 24
10
votes
2 answers

Forwarding traffic from TUN device (C++ backend) to the default gateway

The following problem is just a piece of the bigger solution I have a problem with. All other elements seem working so far, so I'll try to describe very small piece which I have problem with. I've got a linux machine, with tun0 (tunneling interface)…
Marcin Górski
  • 101
  • 1
  • 5
9
votes
1 answer

DNAT port range with different internal port range with Iptables

The standard way of DNATing a single port to a different port on an internal network is something like that: ip(6)tables -t nat -A PREROUTING -i wan0 -p tcp --dport 80 --to-destination 10.0.0.1:8080 If you need a port range you can use -m multiport…
Lorenz
  • 265
  • 1
  • 2
  • 9
9
votes
2 answers

Does the ELB also route outbound reply traffic in AWS

I have been trying to understand how routing works in an AWS VPC with public/private subnets. I have a setup as recommended by amazon with an ELB and NAT in the public subnet and the webserver in the private subnet. I have security groups (SG)…
Ali
  • 290
  • 4
  • 10
9
votes
1 answer

strongSwan setup where both sides are behind NAT

I'm trying to setup a strongSwan server in my home and connect to it from another network. Let's say sun is the VPN server and venus is the client. Both sun and venus are behind NAT networks. sun is not the gateway of my home networks. However,…
reish
  • 384
  • 1
  • 4
  • 13
9
votes
2 answers

Symmetric NAT and UDP Hole Punching

I've read this question, but the explanation of Symmetric NAT wasn't detailed enough. Please could someone help me to understand the following paragraphs? I read this about Symmetric NAT: Each request from the same internal IP address and port to a…
john
  • 1,995
  • 2
  • 17
  • 30
9
votes
3 answers

NAT: If two hosts initiate a connection to the same IP:PORT, with the same source PORT, how does the router handle it?

I was just thinking and that idea came to my mind. Let say I have hosts A and B inside my local area network. I have a Router, and a host C in the internet. I know that when initiating the connection, the source port is chosen randomly, but what…
NullOrEmpty
  • 389
  • 2
  • 5
  • 16
9
votes
3 answers

Windows 7 with internal port redirection, is it possible?

I received a request from one of our developers that I am having trouble solving. Here in the office they use linux desktops and I can forward the localhost:80 via a iptables nat to localhost:8080. What they want is the same thing at home in…
mindlesstux
  • 208
  • 1
  • 2
  • 4
8
votes
3 answers

How widely deployed is carrier grade NAT?

I was just reading How bad is IPv4 address exhaustion really? and noticed this comment, which seems to imply that carrier grade NAT is actually widely deployed. I was always under the impression that very few ISPs deployed carrier grade NAT and…
strugee
  • 891
  • 11
  • 25