Questions tagged [iptables]

Iptables is a module that provides the Linux operating system functions of firewall, NAT and logging of data traveling over a computer network.

Filter by
Sorted by
Tagged with
2 votes
2 answers
82 views

Change all rules in iptables when changing IP address

I have a network gateway system using iptables to allow/deny traffic to/from an internal network. I have to manually add and remove rules in iptables depending on the requirements of the entities in ...
0 votes
0 answers
15 views

Can connect VM 1 to VM 2 across a router, but not VM 2 to VM 1?

EDIT: I just want to say, i found a solution. That is to set up the same routing i did in VM1, to VM2 using: route add 'gateway of first vm' MASK 255.255.255.0 'ip of second vm'. It works now. Maybe i ...
0 votes
0 answers
9 views

Ipsec Site-to-Site: I can ssh to the Target Network but not ssh from the target network, Iptables Troubleshooting

Since this is my very first Question here im still a bit green :) Following Scenario: Ipsec Connection with strongswan on a debian system between two Sites with each 4 Subnets site A: 10.0.0.0/24 10.0....
2 votes
1 answer
54 views

How can I port forward multiple ports on a single IP address when WAN IP is not accessible outside the country

Thailand (and other countries) have a government sanctioned firewall/gateway(s) which routes all your traffic through it. As a result any LAN ports forwarded to your WAN IP, are available within ...
0 votes
0 answers
96 views

can't initialize iptables table `filter': Table does not exist (do you need to insmod?) - iptables is not present

I am trying to install NGINX and Certificate by following this article in WSL: How to Install and Configure Nginx on Ubuntu 20.04 But at the Step 5: Allow Nginx Traffic, I am getting error after the ...
  • 1
0 votes
1 answer
16 views

LXC container cannot reach other LXC container on same host

I have following setup: Proxmox host with two LXC containers. LXC A: 10.0.0.10 LXC B: 10.0.0.30 From within the host i can do wget 10.0.0.30 This works perfectly. But this does not work from within ...
0 votes
0 answers
19 views

Routing KVM VM traffic over wireguard from host OS

I'm trying to setup a Wireguard tunnel on my host OS and route all network traffic from a specific KVM VM over this Wireguard VPN. My KVM VMs are setup using bridged networking. The interface name on ...
1 vote
0 answers
16 views

iptables firewall not allowing connection on port 8080 even if it is open (docker)

I have opened my port 8080 in iptables and i am launching a nextcloud container where port 8080 is exposed and routed to nextcloud server on port 80 inside the container. I cannot reach either ...
0 votes
2 answers
79 views

What is the correct way to restrict access to Docker containers to only allow sources on LAN

I've been trying to find a way to ensure containers selectively are only accessible from the LAN that the (Linux) docker host is part of. I've seen this question asked/answered on Reddit, Stack, and ...
0 votes
1 answer
23 views

How to find the names of all user-defined chains in iptables?

Is there a good way to list the names of all user-defined chains in iptables? By user-defined I mean chains that were created with iptables -N. The reason is that I'm writing a script to reset ...
  • 573
1 vote
1 answer
45 views

address-based routing policy for Linux router?

I have a home Linux router, it connects to the Internet through ppp0(both IPv4/v6), I run a wireguard VPN wg0 on it. Its internal NIC interface is lan0 (192.168.100.1/24, fd42:100::1/120), which ...
  • 13
0 votes
0 answers
21 views

Is there a way to bypass iptable's POSTROUTING rules to access Docker containers?

This question is an extension to this question. To summarize, nateroiger has a Docker container with IP address i.e. 10.0.0.1 in a computer with IP address i.e. 192.168.1.2. They want to ping the ...
  • 101
0 votes
1 answer
168 views

Correct iptables rules for a reverse vpn set up

I set up a VPS to be a reverse vpn to my self-hosted mailserver, and would like to know if these rules I've come up with make sense and are correct for what I'm doing. The mailserver (mailcow docker ...
1 vote
0 answers
127 views

Config Wireguard server to use a socks proxy to access internet

There is a Wiregurad server that is working perfectly, but we need that Wireguard's server connect to the internet using socks proxy through the second server and ONLY Wireguard, Not other programs ...
  • 111
0 votes
1 answer
54 views

How can i access service listen on 127.0.0.1 from another computer

I have a binary executable which listen on 127.0.0.1:5373. But I want others can access the service from another computer just like it listen on 0.0.0.0:5373. Since it is a binary, I can not modify ...
0 votes
0 answers
47 views

OpenVPN access services on same host

I install OpenVPN on Ubuntu 22.04, it works, I can connect to server with clients, surf the web and access to LAN hosts but I can't access to services on the same server. On the server where is ...
  • 1
0 votes
1 answer
54 views

Iptables forwarding rules between two VLANs are not working

There has to be something I am missing. I have two VLANs and want to allow inter-vlan communication for certain IPs and ports, basically I want to let 192.168.16.2 connect to 192.168.15.4:80 and allow ...
  • 17
0 votes
0 answers
17 views

OpenVPN specific network

I have a VPN server (v 2.4.7-1), which can be reached from anywhere on the internet (XXX.XXX.XXX.XXX on eth0). This also serves as a firewall. Because there is indeed a network behind it. Actually two ...
1 vote
0 answers
49 views

How to configure RPi to work as wifi access point that uses a Burp as a proxy?

I am attempting to use a Raspberry Pi Model B+ as a WiFi access point with the IP address of 192.168.0.1. This access point should redirect all HTTP and HTTPS traffic to a different machine with the ...
0 votes
0 answers
41 views

OpenVPN client can't access internet after adding some iptables rules

I have problem for configuring OpenVPN especially at iptables. I'm adding this rules, and OpenVPN client can access the internet iptables -t nat -I POSTROUTING 1 -s 10.8.0.0/24 -o eth0 -j MASQUERADE ...
1 vote
1 answer
45 views

sshuttle VPN works, but breaks website

Im using this command. It works just fine. Im able to download things from the command line that I previously was not able to sshuttle --dns -vvr user@192.168.1.252 0/0 -x 192.168.1.252 The problem ...
0 votes
0 answers
46 views

Route only VPN traffic through another VPN interface by a local bridge

There is a double VPN (mulit-hop) working fine using SE. Two servers have been used server A (SoftEther server) no NAT cascading connection to server B users have been added server B (SoftEther ...
0 votes
0 answers
22 views

Route connections on port 22 to specific IP through jump server with Iptables

I have 2 servers in the cloud where one has access to stfp on port 22 to IP x.x.x.x Server 1 has access Server 2 does not have access. So i want to reroute all connections on port 22 to ip x.x.x.x ...
  • 1
2 votes
0 answers
29 views

Connect to a local pc that is connected through wlan to another pc

I have a PC that is connected to a raspberry (raspbian 10) through wlan wlan0. The raspberry is connected to an internet router through ethernet eth0. The raspberry is able to provide an wlan access ...
0 votes
0 answers
25 views

Iptables Tor only

How do I block all connections except Tor using Iptables? I tried the following script but it didn't work, nothing is loading, including Tor -A INPUT -i lo -p tcp -m tcp --sport 1:65000 --dport 9050 -...
0 votes
0 answers
22 views

How to forward client's traffic from vpn router connected to main router

I am trying to connect my dd wrt router to the main router at home, ethernet cable is connected to lan on main router and wan on ddwrt. DD WRT has connection to my VPN, when i telnet into ddwrt i can ...
0 votes
0 answers
146 views

How to use iptables to forward all traffic on port 80 to another proxy?

I would like to forward all http traffic to another proxy server running on the same machine? How to use iptables to forward all traffic on port 80 to another proxy?
0 votes
0 answers
16 views

Iptables Forwarding

Hi I'm doing forwarding on a centos 7 server over vpn to a html server but also the centos server is providing internet to other computer my question is, how I do forward some ports like 80 and 443 ...
  • 147
1 vote
0 answers
159 views

Using Redsocks to relay UDP traffic

I want to set my up my Ubuntu server as a router to use Redsocks to pass all TCP and UDP (specifically DNS) traffic from my client’s to a SOCKS5 proxy server. So far, I am able to route all TCP ...
1 vote
1 answer
92 views

Ip route : access ip on different interface trough Wireguard VPN

I would like to access from my Windows PC a KNX interface that is wired to a Linux PC trought my wireguard VPN but the interface is on a different subnet. The KNX interface use UDP protocol on port ...
  • 21
3 votes
3 answers
671 views

IPTables how to nat 10.8.a.b to 10.0.a.b?

The problem -- Translate 10.8.a.b to 10.0.a.b ? I have a VPN setup to a bastion host. I'm attempting to map 10.8.0.0/17 into 10.0.0.0/17 so that the IP address 10.8.1.1 gets mapped to 10.0.1.1 in my ...
  • 145
0 votes
1 answer
49 views

Debian Server - clients can't ping between interfaces (eth0-wlan0) / subnets

I can't ping clients between interfaces/subnets e.g. pinging from Mac (10.42.0.82), which is connected to eth0 to the Android (10.42.1.150) which is connected to wlan0. Note: I can access internet ...
  • 1
0 votes
0 answers
112 views

iptables v1.8.7 (legacy): Couldn't load target `standard':Not a directory

I am working on ARMv8 embedded system. I have downloaded iptables-1.8.7.tar.bz2 and cross compile for my board. and copied it on the board. When I run following command I am getting error. root@01:/$ ...
  • 103
0 votes
0 answers
15 views

Routing connection to Azure DB through StrongSwan IPSec site-to-site tunnel

I have a Linux Strongswan IPSec site-to-site connection up and stable to an Azure Cloud Network, I'm trying to route an sql connection with a python script through the tunnel to an Azure database in ...
0 votes
1 answer
37 views

nslookup and IP forwarding with multiple interfaces fails sometimes

I have an embedded system with two ethernet ports. These two ports are connected to two different ethernet ports on a linux box. The linux box has another third port which is connected to the WAN. The ...
  • 1
0 votes
0 answers
27 views

transparent proxy to explicit proxy

Is it possible to send all your traffic (http and https) from a transparent proxy to a explicit proxy? I'm trying to redirect all traffic of my network to a proxy (so clients don't have to configure ...
  • 1
0 votes
1 answer
447 views

Forward client IP addresses through a Wireguard tunnel, instead of masquerading with tunnel IP

I am using a Debian VPS with a static IP to provide port forwarding for a few self-hosted services including a Minecraft server. My current arrangement is functional in that it allows players to ...
  • 11
2 votes
0 answers
44 views

Accessing ethernet device with duplicate ip in separate namespaces

my apologies if this question has been asked somewhere. I've been searching for days and have tried many different things but I am still missing something. The problem I have to connect to multiple ...
  • 21
0 votes
0 answers
9 views

'iptables -L' stalls after adding a rule with --source flag [duplicate]

I want to add a basic iptables rule limiting inbound SSH traffic to a single address. Although, after I specify the -s or --source flag, iptables -L fails to list rules and stalls: ~ iptables -L Chain ...
0 votes
1 answer
10 views

iptables firewall showing tunnel traffic with ens3 public IPv4 as source

I'm seeing very strange iptables logging-rules (in my opinion) for which I can't find an answer / explanation online. I have the following interfaces on my Linux server: - ens3 with public IP XX.XX.XX....
0 votes
0 answers
79 views

What is the analogue of iptables' exclamation mark in UFW?

What would be the analogue of this iptables commad in ufw? iptables -A OUTPUT ! -d 5.5.5.5 -j DROP What is the analogue of exclamation mark in ufw? In other words, how to match all IP addresses ...
  • 13
0 votes
0 answers
15 views

How to send packets from Virtual Tap to different Physical Host

I am running some simulations that is using virtual tap to send and receive packets. Now I want to extend my simulation and send packets to different host. My simulation is sending packets to virtual ...
0 votes
1 answer
107 views

Forwarding requests to localhost with Iptables

I have an Ubuntu VM (in Virtualbox) and a Win11 local machine. I would like to send HTTP requests (for example 127.0.0.1:{PORT}/api/1/) to the virtual machine. The VM has an app running that only ...
0 votes
0 answers
12 views

NAT does not route traffic from client

I have configured NAT(eth1) and client(eth0) at 10.70.1.0/24 with iptables rules and ip forwarding. NAT should route traffic from client to puplic internet(eth0), but it seems there is no traffic. NAT ...
  • 1
0 votes
2 answers
118 views

No forward packet with iptables prerouting rule

I have an iptables prerouting rule to forward a port to another host. This is the rule: ipv4 nat PREROUTING 0 -m addrtype --dst-type LOCAL -p tcp --dport 445 -j DNAT --to-destination 192.168.123.103. ...
0 votes
1 answer
120 views

iptables ESTABLISHED,RELATED in combination with DNS rules

I'm reading Chapter 3 in "Cybersecurity for Small Networks" (Seth Enoka) and have added the following iptables rules in an Ubuntu 22.04.1 virtual machine: # Generated by iptables-save v1.8.7 ...
0 votes
0 answers
315 views

Need some help please, cant set Iptables

I am working with a embedded system that I am trying to set Iptables. I get this error even though I am root: /tmp # iptables -L iptables v1.8.4 (legacy): can't initialize iptables table `filter': ...
  • 1
0 votes
0 answers
43 views

set internet consumption quota by IP

In linux there are many ways to limit bandwidth. As far as I know, it can be done with squid-cache (delay_pools), apache2 (mod_bw), iptables/ipset rules, TrafficToll, etc But, is there any tool that ...
  • 690
0 votes
0 answers
61 views

How to add a SOCKS5 proxy over a GRE tunnel

Here is my network map: host1(Ubuntu) host2(Ubuntu) hostN... | (10.0.0.2) | (10.0.0.4) ... | gre tunnel | gre tunnel ... | (10.0.0.3) | (10.0.0.5) ... remote host (...
1 vote
1 answer
73 views

Is it possible to block Wi-Fi peers from communicating with each other?

I'm still learning, so maybe it's a stupid question. I have created an access point (is it correct to call it router?) on my laptop on linux. I connected two devices (further I call it clients) to ...
  • 13

1
2 3 4 5
37