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.
369 questions
1
vote
0
answers
42
views
Was there ever a dedicated device for NAT? [closed]
When I'm making network diagrams and things of that nature, often I need to put firewalls and routers in them, and I never know what to do with NAT, often I just draw it as an enclave within a ...
0
votes
0
answers
29
views
nftables masquerade on interface with multiple addresses
I have what appears to be a unique situation that I am surprised is unique as it's common to most cablemodem implementations...
I need to masquerade to the dynamic public address provided by $CABLECO ...
2
votes
1
answer
82
views
nftables NAT 'redirect' rule description ambiguity
I'm currently covering nftables NAT rules. There are four of them, namely:
snat: replace the packet's source address with a given one (clear);
dnat: replace the packet's destination address with a ...
2
votes
1
answer
136
views
Nested VPN connection via Wireguard
I designed the following topology:
Client A -> Server B -> Server C
Server C: wireguard server that NATs packets from its clients (in this case just B) before sending them to the Internet. Its ...
1
vote
0
answers
211
views
KVM/QEMU libvirt Network "default" NAT Configuration - Guest cannot connect to Internet (no VPN)
KVM/QEMU libvirt Network "default" NAT Configuration - Guest can connect to host and the host to guest but the guest cannot connect to Internet(no VPN).
$ sudo virsh net-list --all
Name ...
2
votes
1
answer
92
views
How do I make a virtual "alias" for a remote IP without a proxy process?
I have interfaces enp101s0f0u2u{1..3}, on each of which there is device responding to 192.168.8.1.
I want a local processes to be able to reach all of them simultaneously.
This is one process, so ...
0
votes
1
answer
251
views
Zyxel EX3301-T0 router not accessible remotely with static IP
I am attempting to communicate with devices on my LAN via the internet.
I have purchased a static IP for my router.
When I log in to my router, the IP address displayed on the router GUI matches the ...
2
votes
1
answer
355
views
What process can remove an entry from a router NAT table?
I have just been watching a video which explains UDP holepunching.
https://www.youtube.com/watch?v=GfRLNg6DOnI
In this video, some processes which create entries in a router NAT table are explained.
...
1
vote
2
answers
784
views
Connecting to an SSH server behind NAT
I have a situation where I've got a target machine behind a standard home router/firewall/NAT configuration (we'll call it target), and a machine with a known public IP address (we'll call it server).
...
0
votes
0
answers
34
views
odd need to change packet addresses
I have a very poorly designed appliance which advertises wifi.
But what it actually delivers is a device that can only create a hotspot, and the hotspot name is fixed. The address is also fixed. The ...
0
votes
2
answers
63
views
Faking traceroute hops but only for the VM, not for the VM host
I'm trying to modify ICMP time-exceeded responses (type 11) for traceroute packets, but only when they're responses to traceroute probes from a specific VM. My setup is:
Host OS running Ubuntu with ...
1
vote
1
answer
54
views
nft ignores packets on lo?
I have a fairly standard debian 10 system set up as a router (echo 1 > /proc/sys/net/ipv4/ip_forward) with one WAN (=enp11s0) interface and one DMZ (=enp10s0) interface.
The WAN interface has a ...
1
vote
0
answers
214
views
Fedora Linux VM on Windows 10 HyperV host behind a network proxy cannot access internet
I posted this question over in the Server Fault boards but haven't had any response on it, hoping to get some information by posting it over here.
I'm setting up a Fedora VM using HyperV on a Windows ...
0
votes
1
answer
358
views
Wireguard connection to localhost via VPN refused
In order to access my webserver (behind CGNAT on my home PC), I established a wireguard tunnel between my home PC (wireguard IP 10.8.0.3) and a VPS (wireguard IP 10.8.0.1 and public IP 11.22.33.44). I ...
0
votes
1
answer
97
views
NAT table skipped for server replies running inside Docker container
I have a Docker container running on a vanilla setup which listens on port 9999:
docker run --rm -it -p 9999:9999 busybox nc -vvl -p 9999 0.0.0.0
I added a LOG rule to the POSTROUTING table on NAT in ...
0
votes
0
answers
112
views
pfSense routing issues
Ive got a routing issue on my pfSense box that shows the response to a ping request being routed to a IP in a separate subnet/vlan.
10:25:13.239238 IP 10.2.0.2 > 8.8.8.8: ICMP echo request, id 9374,...
1
vote
0
answers
182
views
How do I configure 2 public IP addresses on Debian and enable NAT traversal on one?
I got 2 IP addresses from my hosting company, xx.xx.xx.109 and xx.xx.xx.110, both in the same subnet. The subnet mask is 255.255.255.192 and the gateway is xx.xx.xx.20
I have a Proxmox server and ...
0
votes
1
answer
115
views
iptables: NAT bridge traffic
Background
I have a linux machine with bridge interfaces as shown below...
---{prenat}--> ---{postnat}-->
source: 172.25.0.3 source: 192.0.2.1
+---------------...
1
vote
0
answers
63
views
NAT router with private IP towards ISP and public IP on the second interface, localhost traffic problem
I need help with the following network and router. Under emergency conditions, I received the following network. The router (Ubuntu) has two interfaces and a DNS function. The private address on the ...
0
votes
0
answers
176
views
How to configure DNAT in iptables between host os (FreeBSD) and guest os (Ubuntu 23.10) so that I can use Cloudflare on both the OS
I've just installed the CloudFlare client + GUI on Ubuntu,that I have virtualized with bhyve (the FreeBSD hypervisor). Cloudflare does not work on FreeBSD. The instructions that I have followed are ...
2
votes
1
answer
430
views
How does linux report SNAT port exhaustion [closed]
I would like to monitor a router for potential SNAT port exhaustion. I'm fully aware of how unlikely this is to happen. I would still like to know how I could detect this on my running system. Does ...
1
vote
1
answer
75
views
Packet forwarding from dual stack interface to localhost
I have a linux SUSE host which has both ipv4 and v6 enabled, below are the interfaces:- eth0,app,eth1 however the default route is available for ipv4 via eth0. Kubernetes is running on this host(...
0
votes
0
answers
59
views
How to Allow all NATed traffic from iptables firewall via pfsense (gateway)
I have an iptables firewall (machine 1) and a centos 7 based gateway (machine 2), which is having 2 interfaces (machine-2:int-1) from WAN [/30] and (machine-2:int-2) is LAN [/28] one of the static IP ...
0
votes
1
answer
89
views
Use VPN connection only for selected applications
I am trying to follow: https://superuser.com/a/1262250/41337 but I cannot make it work.
I do:
interface=eth0
down() {
ip netns delete myvpn
ip link delete vpn0
iptables -D INPUT \! -i ...
1
vote
0
answers
98
views
Firewalld is running, I can acccess unallowed kubernetes exposed port?
I have a Kubeadm based Kubernetes cluster. Firewalld is running on all nodes on the cluster.
I expose a nginx service via NodePort service, that on theory should be accessible via all nodes on the ...
1
vote
0
answers
198
views
NAT table in iptables rules and SNAT
I am new to iptables and I would appreciate some help understanding a specific rule in the nat table of a router. The router's external interface is vlan2 (111.111.111.111) and the internal interface ...
2
votes
1
answer
399
views
nft port forwarding not working on router
I have a machine that serves both as a router and a server. I have several lxc containers on this machine, and want to expose them to both the LAN and WAN. Following https://access.redhat.com/...
4
votes
2
answers
9k
views
Launching docker daemon in Ubuntu 22.04 LTS on WSL-2 fails because of iptables
I'm trying to run docker inside of Ubuntu 22.04.3 LTS running in WSL-2 on my Windows 10 machine.
I have followed the instructions here. But it's still not working, I am getting the following error ...
1
vote
1
answer
316
views
Ubuntu router using nftables blocking traffic
I'm trying to set up a simple router in Ubuntu. There are two network interfaces: eth0 - a wired network interface connected to the internet, and wlan0 - configured as an AP with IP address 10.0.9.1.
...
-1
votes
1
answer
462
views
How to connect two machines, both behind NAT?
I have two machines, both behind a NAT-ting router, resulting that they can not exchange packets directly.
However, I believe such a thing would be still possible over some external help, if the NAT-...
0
votes
0
answers
965
views
firewalld and NAT
So i have been given a task to get to know firewalld and linux networking in general. This is my test setup:
Router and Client are running Debian 12, Laptop Ubuntu 22.04.
This setup should accomplish ...
0
votes
1
answer
63
views
Iptables forwards the port to another IP and adds access restrictions
I've added the following rules to iptables.
-A PREROUTING -p tcp -m tcp --dport 3307 -j DNAT --to-destination 192.168.80.45:330
If I want to add a rule to port 3307, for example, to deny access to ...
3
votes
1
answer
579
views
NAT router with 2 external WAN IPs A+B and multiple internal LANs: Let 1 LAN use external IP address B, all other A
I have a simple Linux router with multiple NICs and IPv4 forwarding enabled.
The router has two static WAN IP addresses, assigned to one interface (eth0, eth0:0). (In the following text, I will ...
0
votes
0
answers
98
views
Accessing internet from device connected to AP
I have two interfaces uap0 and eth0 in my embedded Linux device. uap0 acts as an access point for other devices to connect to Linux Device. eth0 interface is connected to my router. And my router is ...
1
vote
2
answers
124
views
SSH connection from internet through server1 (on internet) to local server2(not on internet)
I got some pain to solve the following problem and I would appreciate some help.
I have:
Server1 connected to the internet and connected on LAN1 (Debian)
Public IP: xx.xx.xx.xx
Private IP on LAN1: ...
0
votes
0
answers
642
views
Configuring IPTABLES for Passive FTP Connection through NAT (Forwarding from One PC to Another Using a Second Ethernet Card)
I am trying to connect to an FTP server through a NAT network created by another PC that uses two Ethernet cards. I would like to access via FTP client the second PC's FTP server through the first one....
1
vote
1
answer
2k
views
Can I run PIVPN with Wireguard without MASQUERADING?
When installing pivpn on Raspberry Pi it will create an iptables rule:
pi@RPi64:~ $ sudo iptables -L -t nat ...
1
vote
1
answer
1k
views
nftables dnat map rule failing silently
I'm working from the answer of this question and man nft in order to create some dnat rules in my nftables config.
The relevant config extract is:
define src_ip = 192.168.1.128/26
define dst_ip ...
0
votes
0
answers
121
views
How is it possible that NAT doesn't back translate packets?
I have the following topology
and from myhost I can ping router2 but can't ping router1.
With tcpdump I can observe how my pings go and I see that both router1 and router2 reply. But only replies ...
0
votes
1
answer
462
views
nftables counter for nat'ed traffic
When setting up a counter for a rule in a 'type nat hook prerouting' chain with dnat on a specific port, the counter will only count the initial packet for that rule and the following packets from ...
2
votes
1
answer
835
views
Can nftables perform postrouting matching on crgroupv2?
I would like to change source address of every packet generated by a process in given cgroup (version 2). Is that even possible?
I have:
nftables 1.0.2,
linux 5.15 (Ubuntu variant)
/system.slice/...
1
vote
1
answer
530
views
Packet flow in linux NAT enabled on bridge IP assigned interfaces
On My Linux machine, I have following configuration:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether bc:e6:7c:51:20:6b txqueuelen 1000 (Ethernet)
br0.1: flags=4163<...
0
votes
0
answers
321
views
iptables rules for transit packets port forwarding (NAT) in both directions (still accepting packets to the current server)
I wrote such rules for forwarding all ports to another server and back, but I don't like that I reserve port 10000 for this.
If you do not specify the port, then when receiving requests from 62.105.38....
1
vote
1
answer
1k
views
How to configure port forwarding with nftables for a Minecraft server on Raspberry Pi?
Since I'm using a transparent proxy service, I use a raspberry pi as my home router. Its OS is plain Raspbian. Now I'm setting up a Minecraft server on 192.168.2.28, and am exposing it to WAN using ...
1
vote
1
answer
1k
views
Nftables: Dnat with source address restriction and just one map
Our router machine has multiple public IPs (/27) on its WAN interface. Now, I want to add dnat rules which match specific dport/saddr/daddr combinations.
My dream would be something like this:
map ...
0
votes
1
answer
644
views
Enable NAT with TCPMSS using UFW
I could enable NAT using UFW with following configuration.
*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.141.0/24 -o ens192 -j MASQUERADE
COMMIT
If I want to enable TCPMSS, I have to run ...
1
vote
1
answer
1k
views
Set up NAT between Docker networks
My goal is to run two Docker containers on separate networks and have my host (Ubuntu 22.04) perform NAT so that the first network can reach the second.
My setup:
docker network create network1
docker ...
1
vote
1
answer
942
views
nftables anonymous map for ipv6 dnat
When creating a dnat rule, you can specify the following command:
nft 'add rule ip twilight prerouting ip daddr 1.2.3.0/24 dnat ip prefix to ip daddr map { 1.2.3.0/24 : 2.3.4.0/24 }'
And then get ...
1
vote
1
answer
1k
views
Using ssh reverse tunnel as gateway to reach machine under NAT
I'd like to reach a machine under a network with NAT and without port forwarding.
The machine "closed" behind the no-port-forwarding NAT is called RaspberryB.
This machine create a reverse ...
0
votes
1
answer
91
views
Access VM from LAN
On a Linux laptop, I want to give access to locally hosted VM (kvm) from LAN.
I'd like to do DNAT to VM.
Network
client <-- LAN 192.168.3.0/24 --> host <-- bridge 192.168.113.0/24 --> ...