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
8
votes
1 answer

AWS VPC routing table with both Internet Gateway and NAT Gateway

I have a single VPC in Amazon Web Services with the subnet 172.31.0.0/16. I have created an EC2 instance in this subnet and given it a public Elastic IP. There is an Internet Gateway on this VPC. So, my route table looks like this: 172.31.0.0/16 …
user35042
  • 2,681
  • 12
  • 34
  • 60
8
votes
2 answers

Openvpn routing for lan to lan through tun

I am trying to setup an OpenVPN tun to connect two lan's The open vpn connection is up and working but there is a problem with my routing or nat or something. What I need is an example of what a working, routed openvpn setup should look like on the…
Alex
  • 81
  • 1
  • 1
  • 3
8
votes
2 answers

DMZ subnet: to NAT or not to NAT?

I'm looking at setting up a DMZ behind a Cisco ASA that will contain a large number of HTTP front-end load balancers and SSL offload services - over 100 IPs, concentrated on a smaller number of hosts. In the past I've kept all the hosts on RFC1918…
natacado
  • 3,367
  • 29
  • 27
8
votes
4 answers

Iptables NAT logging

I have a box setup as a router using Iptables (masquerade), logging all network traffic. The problem: Connections from LAN IPs to WAN show fine, i.e. SRC=192.168.32.10 -> DST=60.242.67.190 but for traffic coming from WAN to LAN it will show the WAN…
Gerard
7
votes
9 answers

Need prosumer router/firewall/vpn/vlan/nat advice

Looking for a recommendation on a device (or devices I guess) to do router/firewall/vpn/vlan/nat functons for my home network. Right now, I'm doing this with an IPCop box, but I'd prefer a little less roll-ur-own. Requirements: VLANs to segment…
Robot
  • 337
  • 1
  • 3
  • 8
7
votes
3 answers

AWS yum does not work from private subnet (does work from public)

I have a VPC with a private and a public subnet - each containing an identically built RHEL7 server. I believe the VPC is set up correctly (see following). However, the public server can use yum and the private one can't. The private one receives…
BurningKrome
  • 525
  • 2
  • 12
  • 22
7
votes
1 answer

Iptables udp port forwarding

I'm using latest debian relese and i need to do some port forwarding, but i dont know how.I have 2 stream sources coming to my server on the same udp port from 2 diferent ip-s 192.168.1.2:1003 via udp to 192.168.1.4 (server) 192.168.1.3:1003 via…
user287842
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

Amazon EC2 VPC: NAT instance download speed performance drop

I have a set of servers inside Amazon EC2 in VPC. Inside this VPC I have a private subnet and a public subnet. In the public subnet I have set up a NAT machine on a t2.micro instance that basically runs this NAT script on startup, injecting rules…
j0nes
  • 955
  • 1
  • 12
  • 27
7
votes
1 answer

Port forwarding with iptables -> connection refused

I am trying to redirect requests to my local IP (10.42.42.152) on port 80 to a remote server, e.g. google.com (173.194.113.104:80). The remote server is up, ip_forward is enabled but I only get "connection refused". root@raspi:~# telnet 10.42.42.152…
Jens
  • 362
  • 2
  • 4
  • 14
7
votes
2 answers

How do I forward/NAT all traffic to one interface/IP to a remote IP?

I have one "server A" that has multiple IPs attached to it, like so: eth0:0 1.1.1.1 eth0:1 1.1.1.2 eth0:2 1.1.1.3 I have another "server B" that also has multiple IPs attached to it, like so: eth0:0 2.2.2.1 eth0:1 2.2.2.2 eth0:2 2.2.2.3 Now, I…
Daniele Testa
  • 661
  • 4
  • 10
  • 18
7
votes
2 answers

FreeBSD's ng_nat stopping pass the packets periodically

I have FreeBSD router: #uname 9.1-STABLE FreeBSD 9.1-STABLE #0: Fri Jan 18 16:20:47 YEKT 2013 It's a powerful computer with a lot of memory #top -S last pid: 45076; load averages: 1.54, 1.46, 1.29 up…
Korjavin Ivan
  • 2,250
  • 2
  • 26
  • 41
7
votes
1 answer

How long do Nat mappings live for?

My simple understanding of NAT is something like this could happen: Two client PCs 192.168.1.2 and 192.168.1.3 open up a connection with src port = 12345. The gateway receives these and needs to use NAT, so one of them stays as 12345 and the other…
Alan
  • 189
  • 1
  • 7
7
votes
5 answers

Can a global IPv6 address be NAT'd to an internal IPv4 address at a firewall-level?

As an organisation we've just requested our first IPv6 allocation. At present we are a wholly IPv4 organisation with a global IPv4 address allocation configured on our edge router and used (predominately) to NAT via an edge firewall to internally…
Matthew
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

DNS Server Behind NAT

I've got a Bind 9 DNS server sitting behind a NAT firewall, assume the Internet facing IP is 1.2.3.4 There are no restrictions on outgoing traffic, and port 53 (TCP/UDP) is forwarded from 1.2.3.4 to the internal DNS server (10.0.0.1). There are no…
Bryan
  • 7,628
  • 15
  • 69
  • 94
7
votes
1 answer

How to traverse carrier-grade NAT (large-scale NAT) to reach VPN Server?

I currently run an OpenVPN Server via a home network connection that has a single, public, dynamic IPv4 address. My provider (AT&T U-Verse) will apparently soon switch to a large-scale NAT and only assign me a private IP address anymore, so as it…
Fred
  • 181
  • 1
  • 1
  • 5