Questions tagged [nat]

In computer networking, Network Address Translation (NAT) is the process of modifying IP address information in IPv4 headers while in transit across a traffic routing device.

339 questions
18
votes
1 answer

Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. Provider1, which is gateway address 192.168.1.1 Connected to linux router eth1/192.168.1.2 Provider2, gateway address 192.168.2.1 Connected to linux router…
Flav
  • 183
  • 1
  • 1
  • 5
13
votes
2 answers

How does NAT reflection (NAT loopback) work?

I use the auto generated rules that come from OpenWRT as an example of NAT reflection (NAT loopback). So let's pretend there's a network 192.168.1.0/24 with two hosts (+ router): 192.168.1.100 and 192.168.1.200. The router has two interfaces LAN…
Mikhail Morfikov
  • 10,309
  • 19
  • 69
  • 104
11
votes
1 answer

iptables: redirect local request with NAT

I'd like to redirect local requests to port which is translated with NAT. I have following rules: iptables -t nat -A PREROUTING -p tcp --dport 9020 -j DNAT --to 10.0.3.11:80 however request coming from localhost are rejected: wget…
Tombart
  • 2,630
  • 5
  • 26
  • 39
8
votes
1 answer

Why doesn't NAT reserve ports from the machine's TCP and UDP port pool?

I made two experiments. This is the network for both of them: [private network] [public network] A -------------------- R ----------------- B 192.168.0.5 192.168.0.1|192.0.2.1 192.0.2.8 A's default gateway is R. R has IPv4…
Yd Ahhrk
  • 363
  • 3
  • 12
7
votes
0 answers

What is the difference between iptables and ip route table?

Recently I am learning iptables, I know there are 5 independent tables, two of them are filter and nat tables. And I sometimes will look at netatat -r or route table, I know ip command can modify this routing table. I am a bit confused about these 2…
chengdol
  • 155
  • 1
  • 6
7
votes
1 answer

OpenVPN and routing problem on OpenWRT

My home topology: router1 (192.168.1.1) - D-Link dsl2540u server with static IP available from Internet (ADSL via ppoe). 4 LAN ports. router2 (192.168.1.2) - D-Link DIR-300 with OpenWRT. Plays role of WiFi access point. 4 LAN ports + WAN port. …
Alex
  • 71
  • 2
7
votes
3 answers

iptables: The "script" way or the "*filter, rules, COMMIT" way?

I'm trying to figure out how NAT and iptables work. While I'm in the trial-and-error phase of learning about it, I found two somewhat conflicting howtos. One howto uses a script to call iptables rules one after another. The script seems to be named…
zebonaut
  • 1,115
  • 3
  • 16
  • 31
6
votes
2 answers

Unable to get NAT working via iptables PREROUTING chain

So, not concerning ourselves with the WHY, and more so with the HOW, I'd like to see if anyone knows where I'm going wrong here. Basically, I'd like to forward all packets headed for port 80 on an IP that I've aliased to the loopback device…
Andre Goree
  • 91
  • 1
  • 1
  • 7
6
votes
3 answers

GlusterFS how to failover (smartly) if a mounted Server is failed?

In GlusterFS, lets say i have 2 Nodes (Servers) on a Volume. Lets say the volume info is something like this: Volume Name: volume-www Brick1: gluster-server-01:/volume-www/brick Brick2: gluster-server-02:/volume-www/brick From the Client, as we…
夏期劇場
  • 1,571
  • 9
  • 22
  • 35
6
votes
2 answers

Send traffic to self over physical network on Ubuntu

I have a dual port ethernet NIC and let's say I have connected both ports in a loop and assigned the following IPs to the 2 ethernet interfaces: eth2 -> 192.168.2.1 eth3 -> 192.168.3.1 I want to send traffic from 1 of the ports to the other over…
elleciel
  • 465
  • 2
  • 5
  • 12
6
votes
1 answer

How to open VPN connection inside other VPN connection under Linux/Ubuntu

Is it possible to have two VPN connections on top of each other under Ubuntu? Scenario: My organization is quite large and has its own large network. Each group inside the organization has its own subnetwork. All subnets go through a router. The…
newtovpn
  • 61
  • 1
  • 2
5
votes
1 answer

iptables: how to allow traffic from redirected port

I have a web service running on debian 7 and listening on port 8080. I want to redirect 80 to 8080 for inbound connections and allow only port 80. Here is my iptables configuration: root@localhost:~# iptables -v -L --line-numbers Chain INPUT (policy…
Deniz
  • 151
  • 1
  • 3
5
votes
2 answers

How does iptables MASQUERADE work on the incoming side?

I'm still reading the iptables manual page and other documents and digging around questions and their answers. This is the problem which arises. When we setup the NAT we use a POSTROUTING rule such as this: iptables -A POSTROUTING -t nat -j…
sandun dhammika
  • 189
  • 1
  • 7
5
votes
1 answer

Port forwarding & NAT with nftables

I have an OpenWRT gateway (self-built 19.07, kernel 4.14.156) that sits on a public IP address in front of my private network. I am using nftables (not iptables). I would like to expose a non-standard port on the public address, and forward it to a…
Dave M.
  • 208
  • 2
  • 7
5
votes
2 answers

Implicit Inverses for iptables NAT Rules

Does iptables implicitly and automatically add the reverse/inverse rules for every NAT rule that is added explicitly? Typically, assuming a DROP policy, for each INPUT rule in the filter table there is a corresponding OUTPUT rule which accepts…
igal
  • 9,666
  • 1
  • 42
  • 58
1
2 3
22 23