Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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.

0
votes
0answers
23 views

Change default interface docker container

I'm struggling with this problem for two days. Assumptions: Docker network (and interface) named docknet type bridge subnet 172.18.0.0/16 Two interfaces eth0 (192.168.1.1) and eth1 (192.168.2.1) ...
0
votes
1answer
11 views

Trying to setup port redirection through 2nd gateway

I am trying to setup configuration where all connections to port 161 will go through another gateway (through openvpn) while others are going directly [localhost] -> [gateway] -> [remote] - OK [...
0
votes
1answer
20 views

How can I make a service running in Guest VM in VirtualBox accessible outside the VM

I use Oracle VirtualBox and have a service that runs on a guest VM. If I'm under guest OS and open the service URL in Firefox the app works as expected: https://localhost:8443 I was told that I can ...
1
vote
0answers
22 views

Contact a VPN server from outside the network [on hold]

I've to set up a VPN access. First, I just installed OpenVPN on a server on my network. I've installed my VPN server on 192.168.10.14. The network is working well, but i have no way to communicate ...
0
votes
1answer
24 views

Multiplex multiple services on same port discriminating by source port

imagine that on the same host I have 2 services: an ssh daemon listening on port 22 a socks5 proxy listening on port 1080 I want to multiplex both services using only port 22 but depending on the ...
0
votes
0answers
10 views

Security implications of using either veth-NAT vs. veth-Bridge for network namespaces(linux)?

My goal is to use linux namespaces for sandboxing/isolation. I run for instance a debootstrap / pacstraped image using systemd-nspawn, LXC or docker... While I am reasonably aware of most namespaces ...
0
votes
0answers
26 views

Bandit0 'Broken Pipe Error' Problem

Tried to connect with ssh -p 2220 bandit0@bandit.labs.overthewire.org and after successfully entering the password, I'm met with this error: packet_write_wait: Connection to 176.9.9.172 port 2220: ...
2
votes
1answer
32 views

How can I access a virtual machine running on a remote machine directly?

My local Lubuntu's wifi IP address is 192.168.1.97 A remote Lubuntu's wifi IP address is 192.168.1.198, A virtual machine running on the remote Lubuntu has IP address 192.168.122.169. I can access ...
0
votes
1answer
48 views

Changing Destination IP address using iptables and DNAT

I am trying to experiment with DNAT in PREROUTING. I found a tutorial here. It contains the following sentence: This is done in the PREROUTING chain, just as the packet comes in; this means that ...
0
votes
1answer
30 views

iptable dnat rule not working ubuntu

I'm trying to create a simple iptable rule using the command sample below. But the routing does not work. Any inputs on what is missing as I'm not familiar with iptables. sudo iptables -t nat -A ...
0
votes
0answers
29 views

not able to do source NAT

My linux board has 2 interfaces one physical eth1 and another tap interface tun0. i need to forward all the packets with source IP as tun0 IP to eth1 IP. So i was thinking of using natting. I used the ...
1
vote
0answers
23 views

VMware Workstation guests NAT adapters always got the same IP address

I'm on Windows and created three Ubuntu 18.04 Desktop virtual machines using VMware Workstation. This is my NAT and custom host-only network configuration. This is my guest VM's network adapters. As ...
1
vote
1answer
30 views

Web Server access via second interface

I’m trying to access a Web Service (port 8080) on my Raspberry Pi via both of the following interfaces (which have static IPs): Ethernet (eth0, 172.22.0.99, connected to a Netgear router). Wi-Fi (...
0
votes
0answers
22 views

DNAT forwarding based on source

I want to setup two IPSec tunnels using two different Google Cloud VPN gateways -- GW_IP_1 and GW_IP_2 -- with two behind-NAT routers -- R1 and R2. Something like this: GW_IP_1 ---\ ...
1
vote
0answers
27 views

NAT box with two external interfaces and two network namespaces

I have an ARM embedded system with kernel 4.9.62 that has two physical interfaces as shown below: ________ +-------...
0
votes
1answer
172 views

Xen on Ubuntu 18.04 with IPv4 (NAT) and IPv6

I'm renting a dedicated server at Hetzner and installed Ubuntu server 18.04 LTS on it. I've got two public IPv4 addresses named x.x.x.x and y.y.y.y and one IPv6 /64 block for connecting my private ...
3
votes
2answers
37 views

Why does my NAT setup only work properly from time to time?

Homework assignment... There are 3 computers in a local network: 192.168.0.185 (the 'client'), 192.168.0.129 (the 'gateway') and 192.168.0.81 (the 'server'). The 'server' is running a HTTP server, so ...
0
votes
0answers
132 views

Redirecting UDP to local port the reply packet isn't SNATed, w/ iptables

I ran dnscrypt-proxy or tor on Linux listning on [::]:1053 to server DNS. I wanted to make all my Linux host's DNS queries transparently use that proxy. This is what I found from Internet how we ...
0
votes
1answer
77 views

Source NAT rule for LXC containers

I've just noticed that MASQUERADE iptables rule added by lxc has ! -d part: iptables -t nat -A POSTROUTING -s 10.0.3.0/24 ! -d 10.0.3.0/24 -j MASQUERADE My guess is that -s 10.0.3.0/24 -d 10.0.3.0/...
1
vote
3answers
246 views

in iptables, does MASQUERADE match only on NEW connections (SYN packets)?

I observed that MASQUERADE target does not match on packets in the reply direction (in terms of netfilter conntrack). I've a single simple -t nat -A POSTROUTING -s 10.a.0.0/16 -d 10.b.0.0/16 -j ...
1
vote
2answers
182 views

NAT a specific IP to go to ppp0 and others to go to eth0 coming from internal wifi interface

Basically I have a armbian distro configured as NAT where wlan0 is the internal interface and eth0 is the "pubic" interface that provides internet (this set is provided out of the box by armbian-...
1
vote
1answer
328 views

How to get WAN IP of a router on double NAT (not a public IP)?

I am on double NAT (behind 2 routers). I known how to get the public IP by visiting some webpages or use dig command. Yes I known WAN IP usually same as the public IP. I talk about WAN IP #2 that ...
1
vote
1answer
92 views

AWS CLI, pass output of previous command as input for another?

I would like to create a Bash script that will start and stop specific resources in AWS. The problem I have is I would like to create a resource the requires the a specific resource ID that was ...
1
vote
0answers
242 views

order of rules' processing in iptables chains [closed]

Isn't the order of processing the rules in iptables top to bottom? Given the following example; Chain DOCKER (2 references) target prot opt source destination RETURN ...
1
vote
0answers
465 views

DROP or REJECT packets from PREROUTING NAT table in iptables

Goal is to allow only specific networks to access docker container services/ports running on my server. Tried adding ACCEPT rules in to INPUT filter chain. That did not help, networks even without ...
1
vote
0answers
96 views

qemu guest is bypassing host's firewall

I've got a Ubuntu host running several virtual machines using qemu-kvm. Every guest should use our local DNS server, so I blocked outgoing DNS requests using ufw on the host machine: sudo ufw deny ...
2
votes
1answer
383 views

Docker container hits iptables to proxy

I have two VPSs, first machine (proxy from now) is for proxy and second machine (dock from now) is docker host. I want to redirect all traffic generated inside a docker container itself over proxy, to ...
2
votes
2answers
216 views

nftables / iptables rules to rewrite source IP by interface

I have a physical network with a Linux server (Ubuntu 16.04, kernel 4.13) and several gadgets on it. Each gadget has the same unchangeable static IP, e.g. 192.168.0.222/24. I would like to ...
2
votes
1answer
249 views

iptables NAT multiple devices with same IP address

I have a challenging situation where I have 5 devices which act as wireless access points. I need to be able to access TCP 8080 on each device from a central device. All wireless devices have a 192....
0
votes
0answers
58 views

When are inverse NAT manipulation applied by netfilter/iptables?

If there is a DNAT rule in the PREROUTING chain like this one: iptables -t nat -A PREROUTING -j DNAT --to-destination x.x.x.x All packets reaching the stack from a network interface will first pass ...
0
votes
0answers
24 views

Iptables DNAT blocking firewall host

I have a machine where I manage the firewall using UFW. I have setup a few DNAT rules. It works well from the network but not at all from the server itself: Server IP: inet 10.0.4.4/23 brd 10.0.5....
0
votes
0answers
29 views

iptables: lost source address after port forwarding on vpn connection

I have an account with a VPN service with a static IP, this allows me to run a mail server with a clean IP and a PTR. Router (ASUS Merlin) connects to this service with the PPP/PPTP client, then ...
0
votes
2answers
302 views

How to establish a man-in-the-middle scenario with ebtables and iptables

For testing and educational purposes I want so set up a man-in-the-middle scenario as follows: Host T is the target host that is to be "cloned" Host M is the man in the middle with interfaces eth0 ...
1
vote
1answer
29 views

NAT/Masquerade. Was working before, now is not

So for at least two months I had an IP tables configuration that was working on a compute cluster to provide internet access to compute nodes that were technically offline, via the headnode. We ...
2
votes
0answers
268 views

iptables network address translation from lan to vpn [closed]

June 13, 2018: I found a solution and have edited this post in case it is useful to someone. First, the original post: I have a portal where I want to do network address translation from its public ...
0
votes
1answer
520 views

change source address of outgoing traffic on specific ports

I would like to be able to change the source address of all traffic that is going outbound from my linux server on ports 53 (DNS), 67 & 68 (DHCP) I tried with iptables/firewalld: firewall-cmd --...
0
votes
0answers
112 views

connect to two separate LANs with a single interface

I have a group of computers that I wish to connect to two LANs, which I want to otherwise keep separate. Each computer only has one ethernet port; currently I am connecting to LAN1 via wifi with DHCP ...
2
votes
1answer
28 views

Unable to register SIP via WiFi

We run a FreePBX server on our LAN and softphones can register using the local SIP server IP. I need these softphones to be able to register over the internet too so we have configured the firewall ...
0
votes
0answers
152 views

Can't connect to OpenVPN server after installing new nic

In an effort to improve an old ubuntu machine I use for Samba and a vpn/pihole solution I added an ethernet card that supports gigabit. I have set the same static ip on the new card and all other ...
0
votes
1answer
46 views

How to do port address translation to connect to a reverse port forward locally

I'm running 4 splunk indexers and I have to connect to it on port 9997. I have no direct line of sight or any way of routing to these splunk servers other than reverse ssh portforwards which I can ...
1
vote
0answers
131 views

How to keep reversed SSH tunnel alive and safe

I need to SSH to a computer that is behind a NAT. To this end a reverse SSH tunnel from that computer (with SSH server installed) is established to my publicly visible server (middleman.example.org): ...
3
votes
1answer
43 views

Map a port to another on same machine

I have all the traffic coming on port 22. I chose a random port 221 on which i want all of the traffic to be routed. This is the rule i used iptables -t nat -A PREROUTING -p tcp --dport 22 -j ...
0
votes
1answer
197 views

Linux NAT is using the internal IP address for remote traffic

For some reason my NAT is only allowing connections on the local network. When I ping the local network, the packets come out with the NAT gateway as the source. When I ping the remote network (...
1
vote
0answers
2k views

Correct way to configure CentOS7 NAT router?

The Background I have searched and scoured the web for information on the proper configuration of a NAT host running CentOS7 and firewalld for more than one private network. I have a working ...
0
votes
3answers
798 views

Route certain client through Openvpn tunnel

I have openvpn client running in my centos box which I use as a router for my internal network. I have two interfaces for reach outside world. eth0 - normal internet tun0 - openvpn tunnel I ...
0
votes
2answers
888 views

Mangle rule for intercept DNS traffic form specific IP and redirect to another DNS server - openwrt

I have media box in my network that hard coded to use specific DNS servers like Google DNS. But I want force this device to use my own DNS servers instead of hard coded DNS. Only way I think this is ...
1
vote
0answers
55 views

What does 'Total: 418 (kernel 35238)' mean in `ss -s` output?

I'm investigating why sometimes I can't connect to some random machines/ports outside of my server (which has hypervisor with NAT for guests) network. What does Total: 418 (kernel 35238) here means? ...
1
vote
1answer
21 views

vboxnetflt : NAT ok but rules not visible with iptables, how possible?

This is just to improve my knowledge than to fix an issue. How virtualbox NATing rules are invisible from iptables's host? Debian 9.4.0 Virtualbox 5.2.8r121009
0
votes
1answer
136 views

How to connect to LAN-Apache using external domain but restrict access to local network

I have set up a virtual host (sub.domain.com) on my local network server that is accessible from inside and from outside via port forwarding in my router. I would like to add an additional directory ...
1
vote
1answer
79 views

How to find rule by number of pfctl output in FreeBSD?

I have the following excerpt from pfctl -vvss command: re2 icmp 10.10.0.62:1 <- 192.168.10.56:1 0:0 age 00:08:30, expires in 00:00:05, 192:7 pkts, 14400:584 bytes, rule 117 id: ...