Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
100 views

How to simulate a NAT network in Ubuntu host with iptables and iproute2?

I want to simulate NAT network mode of virtual machines without using any vm-specific tools. The detailed goals are the following: The VMs have internal network IP 10.8.20.0/24 The physical nic eno1 ...
Evian's user avatar
  • 101
0 votes
2 answers
1k views

iptables -t nat seems not working properly

I'm working on Ubuntu 20.04. I set the following iptables rules: sudo iptables -t nat -A POSTROUTING -d 192.168.10.162 -j MASQUERADE sudo iptables -t nat -A PREROUTING -p tcp --dport 445 -j DNAT --to-...
li_jessen's user avatar
  • 157
0 votes
1 answer
5k views

How to port forward my ubuntu 22.04 using iptables

Do you know how to gives iptables rules to my machine in order to allow trafic from my public interfaces(wlp3s0) to my private interfaces(lo). Kinda with this topology: 192.168.1.1:80 => 127.0.0.1:...
user avatar
0 votes
0 answers
323 views

Home Router NAT Network configuration Ubuntu 20.04

I have Ubuntu 20.04 desktop and home router and I trying to open ports to have an acces from internet. Here is interface info 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN ...
Alex's user avatar
  • 1
-1 votes
1 answer
5k views

Ubuntu 20.04 gateway, iptables NAT and port forwarding

i am in a maze, i try in vain to setup the rules to be able to acces from internet my internal web server (192.168.12.10). at home, i have an Ubuntu 20.04 gateway (192.168.12.1) with two interfaces : ...
clorant's user avatar
0 votes
1 answer
4k views

Bad argument in iptables NAT command

I am trying to do a DNAT rule in iptables if the packet with source address 192.168.86.212 and destination address 192.168.86.212 then change the destination address to 172.217.5.100. sudo iptables -t ...
ITnewbie's user avatar
  • 137
1 vote
1 answer
572 views

Network routing and port forwarding problem

I have 2 networks (graph in link below) A: 10.0.0.0/24 B: 192.168.1.0/24 In network A, all devices are connected via a switch. Some devices provide certain services such as ssh or access to a database ...
Wojciech Stańczuk's user avatar
0 votes
1 answer
6k views

Link-local 169.254.x.x address assigned at boot despite static IP on 20.04 LTS [closed]

I have been struggling to setup my Ubuntu machine as a simple 2-NICs router with NAT, trying to stick to most recent recommended methods, namely netplan for the NICs and ufw for firewall and for ...
bobmorane's user avatar
0 votes
1 answer
505 views

IPSEC site-to-site overlaping networks

we have two sides connected over ipsec using strongswan. both machines ubuntu 16.04 servers. the issue is both end subnets are overlapping. we have tried all possible iptables scenarios to map ...
marliyev's user avatar
1 vote
1 answer
3k views

Ubuntu Server - "Virtual" Network Interface with Internet Access

I have an Ubuntu 18.04 server with one public network interface (eth0). I'm trying to create additional "virtual" network interfaces that will also be able to access the internet with NAT rules set up....
RogueKnight's user avatar
1 vote
0 answers
156 views

Permanent redirect on Ubuntu for Mosquitto bidirectional MQTT traffic

I need to permanently redirect all traffic in the short term from an old mosquitto server to a new one until the firmware updates have been completed on the edge devices. I tried using iptables as ...
johnrscott's user avatar
0 votes
1 answer
6k views

How to use IPtables for load balancing in gateway

I have 3 NICs. NIC1 and NIC2 are used for internet connections an LAN is used for intranet connection. I want to balance the load to ISPs using ip tables. As I am a noob, my crude attempt is given ...
Purushothaman's user avatar
1 vote
1 answer
4k views

iptables setup for routing

I want to setup my ubuntu computer to route packets. Therefore I've read several tutorials which always had many rules to add to iptables. I finally found out, that the only rule needed (given that ...
Codey's user avatar
  • 113
1 vote
1 answer
3k views

Routing between 2 wired interfaces without using NAT features

I have two internal networks (I do not want/have Internet access) where I connect my Ubuntu 14.04 (with eth0 and eth1 network interfaces). From eth0 (network 192.168.0.0) I connect another PC1 ...
user4467097's user avatar
0 votes
1 answer
2k views

iptable matching rule for STUN/TURN traffic

I am looking for finding TURN/STUN packets coming on a 443 port. According to the TURN RFC, Bytes 46 to 49 are TURN packet magic cookie '2112a442'. Here is the screenshot from wireshark where I found ...
Panduranga Rao Sadhu's user avatar
1 vote
0 answers
767 views

16.04 iptables NAT weird behavior keeps working when removed

root@p10:/proc/net# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial OVH Public Cloud Server, on ...
Bibelo's user avatar
  • 399
0 votes
0 answers
436 views

lxd container with openvpn server does not apply iptables nat rule

I'm trying to setup openvpn on one of my lxd containers to allow access to the container network. The server seem to work and I can access (ping) containers which have a static route pointing to the ...
azzid's user avatar
  • 866
1 vote
0 answers
56 views

how to view the interfaces for each connection in the nat table?

I've used cat proc/net/ip_conntrack to view all the connections related to the NAT table on the device. But this doesn't give any information with respect to the interface used and the type of nat for ...
Akshaya's user avatar
  • 11
2 votes
1 answer
6k views

ubuntu iptables NAT & Router & Port Forwarding

I would like to forward the ssh port from ubuntu-fw (firewall) to ubuntu-server1. | Internet | --- | Router (hardware) | --- | ubuntu-fw | ---- | ubuntu-server1 | Router (hardware): Fritz-Box ...
pallago's user avatar
  • 121
5 votes
2 answers
20k views

NAT using iptables on Ubuntu 16.04 doesn't work

I used to use Ubuntu 14.04 trusty for our NAT server (build on Google Cloud Platform), but recently I tried to use the Ubuntu 16.04 xenial. I configured perfectly same as I've done in 14.04, but it ...
Shinichi TAMURA's user avatar
1 vote
1 answer
1k views

Ubuntu: VPN kills NAT

Output: Wireless Info Script Connection is ISP router (DHCP) - eth0 192.168.1.91 - wlan0(NAT/DHCP) 192.168.5.1 I'm using hostapd to bring up the AP, /etc/network/interfaces to create interface and ...
orion_134's user avatar
1 vote
2 answers
2k views

Forward packets from bonded LAN interface to WAN

I am not able to route packets between the lan side of my ubuntu server and the wan side. I'm looking for some assistance. I have 5 ethernet ports on my server - 1 onboard (eth0, used for wan) and 4 ...
Simply8219's user avatar
0 votes
1 answer
899 views

Cant connect an ESXI host behind an ubuntu NATusing Vsphere

I have 2 NIC's on ubuntu ; eth1 (pci-e based net. card) > WAN (router) and eth0 (onboard) > server (onboard) (no cross cable) so what I want is to access both ubuntu (vnc and ssh) and esxi server (...
xDeathwing's user avatar
1 vote
0 answers
122 views

Keep the same port number for forwarded packets

I have the following IPSEC setup: LEFT (IPsec) <===> MID (PPP) <=ppp=> RIGHT (IPsec+PPP) All running Ubuntu 14.04 LTS. MID communicates with RIGHT in PPPoE (marked ppp). Now... IPsec servers ...
orangesomethingorange's user avatar
1 vote
1 answer
140 views

File copy fails over Ubuntu Gateway using NAT

I have managed to successfully set up NAT on my Ubuntu 14.04.4 machine so that my computer acts as a gateway for a computer connected on the internal interface (eth0) to the external interface (eth1)....
CJCombrink's user avatar
0 votes
1 answer
6k views

Port forwarding with DNAT not working

I want to forward my local port 2221 to a remote machine (192.168.2.100), where ssh listens on port 2222. Connecting to the remote machine works: ssh -p 2222 192.168.2.100 [email protected]'s ...
DoRe's user avatar
  • 21
1 vote
0 answers
5k views

Setting up NAT forwarding using iptables on ubuntu server 14.04

I have a server with 2 ethernet interfaces(em1 and em2). em1 is the internet facing interface(192.168.16.113) and em2 has a static address(10.1.1.100) connected to a switch. I have configured the ...
Hari K's user avatar
  • 41
0 votes
1 answer
135 views

DNAT redirecting to specifc port is not working

I want to redirect ssh by port using DNAT, and i do try to ssh it through the command > username@IP_ADDRESS:10003, and I got this message: ssh: Could not resolve hostname IP_ADDRESS:10003: Name or ...
Adam's user avatar
  • 329
2 votes
1 answer
1k views

configure iptables to redirect traffic to a specific IP address

I have just began using iptables. I have a server with a public ip address (A.A.A.A) wich is hosting a Virtual Machine (B.B.B.B) on local network. I want to redirect all inbound traffic on the port ...
Riadh Hamdi's user avatar
2 votes
1 answer
3k views

NAT port forwarding using iptable doesn't work

I have a server with Ubuntu Server and a Xubuntu virtual machine on it, virtualization software is virt-manager. Ubuntu Server IP: 172.16.63.140 Xubuntu Virtual Machine IP: 192.168.122.4 I can do ...
Luca's user avatar
  • 221
0 votes
1 answer
190 views

How to use my ubuntu server as router?

+---+ eth1- *.1.6| S | =========| | |PC1|private net -------------------- | |=============...
Dgn_OABS's user avatar
  • 155
0 votes
1 answer
484 views

How to setup IPTABLES for logging/monitoring usage while using a DSL with a dynamically assigned IP

I am trying to set up a system to do NAT and other iptables-stuff (like logging, firewall, monitoring, etc.). The ISP provides a dynamic IP address and the DSL modem does NAT. I have the following "...
Sunny's user avatar
  • 129
29 votes
2 answers
114k views

What's the difference between PREROUTING and FORWARD in iptables?

I am trying to understand how this system works and I have problems to understand the difference between using NAT PREROUTING or filter FORWARD. From what I understand, the PREROUTE can send the ...
GheorGhe's user avatar
  • 403
0 votes
1 answer
1k views

Setup NAT on Ubuntu 14.04

I'm trying to insert my desktop between an appliance and the rest of the network to monitor the traffic coming off of it due to some security concerns. I'd like to setup NAT so that the devices behind ...
flickerfly's user avatar
  • 7,309
5 votes
0 answers
10k views

Using Ubuntu 14.04 as router with iptables, clients can't go online. Probably DNS issue, iptables setting needed [closed]

CORRECTION 3: SOLVED! I needed to add the the official DNS server of my departement's VLAN as DNS to the clients. I've read through a large number of posts about iptables issues when using Linux as ...
zerweck's user avatar
  • 150
1 vote
0 answers
35 views

NATing ports selection using hardware detection

I have a linux box to be used as a router with a wlan port in AP mode. The internet input to the board may come from either an eth port (WAN mode) or another wlan port. There is also VPN running that ...
Pushy's user avatar
  • 11
1 vote
1 answer
2k views

Dnat prerouting does not work on Ubuntu 14.04 [closed]

I've got a Ubuntu 14.04 server used as firewall, router, dhcp, dns and proxy. Everything works properly from inside to the internet, but the forwarding from outside to the inside network doesn't work. ...
novaisjp's user avatar
9 votes
2 answers
2k views

How to disable NAT for IPv6 (NAT66)?

The current Ubuntu LTS does not support NAT tables for IPv6 (i.e. there is no ip6tables -t nat), and I'm fine with that, in fact, a NAT-less environment is the "core" of my networks. But, the next ...
ThiagoCMC's user avatar
  • 829
0 votes
2 answers
2k views

Ubuntu 12.04 LXC nat prerouting not working

I have a running Debian Wheezy setup I copied exactly to an Ubuntu 12.04 While the Debian setup runs flawlessly, the Ubuntu version dies on the prerouting to containers ( or so it seems ) In short: ...
petermolnar's user avatar
2 votes
1 answer
890 views

NAT forwarding not working

I tried to set up forwarding from eth0 to wlan0 in ubuntu: echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -F iptables -F iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE iptables -A ...
jcai's user avatar
  • 121
1 vote
1 answer
700 views

redirect traffic from 2 Ubuntu external NICs to specific internal hosts

I am having problems redirecting incoming traffic to 2 external facing interfaces on my Ubuntu 12.10 server to 2 separate internal hosts. I am able to redirect incoming traffic on my eth0 just fine to ...
user127875's user avatar
2 votes
1 answer
5k views

Log destination IP with iptables

I want to log destination IP addresses in my Ubuntu router. I have two network cards eth0 - 10.0.101.254 eth1 - 10.0.101.253 10.0.101.254 is the GW for all hosts on my network. The router works ...
Gunnar's user avatar
  • 145