Questions tagged [iptables]
iptables is the userspace command line program used to configure the Linux 2.4.x and 2.6.x IPv4 packet filtering ruleset. It is targeted towards system administrators. Please, when asking a question about iptables, add the output from the following command: iptables -L -v -n
6,674
questions
0
votes
1
answer
443
views
Whats wrong with firewall configuration with iptables
I have below firewall configuration which is DROP/DENY by default but I am unable to browse any webpage what am I missing ? Note:- I have ens33 as interface and Ubuntu is the OS I m using.
root@...
2
votes
1
answer
4k
views
What wrong with snat in nftables?
I have two virtual machines (server, client) with wireguard vpn.
When i try ping any IPv6 resource from client packets doesn't return to client.
Tcpdump show me ICMP Reply packets in enp0s3 interface ...
0
votes
1
answer
4k
views
Linux iptables: why there is no PREROUTING hook in the filter table?
If I don't want to receive certain ports at all in my server I would rather drop such packets as early as possible, ie: before doing the routing.
sudo iptables -I PREROUTING -p tcp --dport 80 -j DROP
...
1
vote
2
answers
871
views
Nated traffic don't return
i'm trying to configure a dedicated firewall using iptables,
see here my network diagram
My firewall have 5 interfaces 4 for network and other for wan
WAN eth0 192.168.1.2/24
Lan1 eth1 192.150.1.1/...
0
votes
0
answers
47
views
VPS randomly rejects networks
I am running a couple of vps with different hosting companies. One of our servers is causing a lot of trouble lately by randomly rejecting certain networks (office, home, mobile hotspots) from ...
2
votes
2
answers
6k
views
Block *local* traffic with 'iptables' ; but allow *remote* traffic
Is it possible to use a Linux Firewall to block (or 'drop') all incoming packets to a particular port that originate on the local machine ?
Ideally: I would like to still allow remote traffic access ...
1
vote
1
answer
4k
views
Is there an equivalent package to "iptables-services" in Debian 9 Stretch?
I would like to administer my firewall by good, old-fashioned iptables commands saved by iptables-save instead of ufw or firewalld. For RHEL, there is a neat little package called iptables-services ...
0
votes
0
answers
613
views
How to redirect HTTP and HTTPS traffic to custom chain iptables
I am trying to redirect all output HTTP and HTTPS packets to my custom chain, but it doesn't work
Here is my rules
iptables -t nat -N CUSTOMCHAIN
iptables -t nat -A PREROUTING -p tcp --dport 443 -j ...
0
votes
1
answer
1k
views
Restrict OpenVPN access to just some websites
I want to provide a VPN service with OpenVPN to an acquaintance through my server only to access (a) specific website(s). In fact, even though I trust them to the point of granting them access to my ...
1
vote
1
answer
2k
views
iptables SNAT not working for GRE packets
I am trying to apply SNAT to a PPTP client. The TCP/1723 packets are being SNATed properly but not the GRE ones. Can anyone spot what's wrong?
I have the following iptables configuration:
$ sudo ...
0
votes
1
answer
6k
views
Custom chains Iptables and predefined
Hi I wonder how do custom chains work in iptables.
I have found interesting rules for custom chains.
iptables -t nat -N CUSTOMCHAIN
iptables -t nat -A CUSTOMCHAIN -d 127.0.0.0/8 -j RETURN
iptables -...
1
vote
1
answer
96
views
Block Clients based on RTT
I am running an application on my Debian server, which uses IPv4 and UDP for data communication.
I would like to block every client for a short while, that has a Round Trip Time above 140ms.
...
0
votes
1
answer
650
views
Send received mirrored traffic using iptables to docker application?
I have a setup that receives mirrored traffic from many IP addresses on my network card (eth0).
I wanted to send the received packets destined to a particular IP address(say 8.8.8.8) to a docker ...
1
vote
1
answer
881
views
Conntrackd cache not showing tcp sessions
I am experiencing a somewhat weird issue with conntrackd. I have created an environment with an active/backup scenario where sessions will be replicated to the backup after a failover and vice versa. ...
0
votes
1
answer
1k
views
IP white list for docker containers with iptables and ipset
I want to restrict access to docker container ports just from specified IPs.
I set up iptables rules with ipset.
I have exposed the port 8888. The requests from port 8888 are forwarded to simple ...
0
votes
1
answer
2k
views
DNSMASQ eth0 doesn't get an ip address
The information below show's the current contents of my /etc/network/interfaces, /etc/dnsmasq.conf, iptables-save output and /proc/net/ipv4/ip_foward files. From the ifconfig -a information (shown ...
3
votes
1
answer
12k
views
iptables forward external ip and port to internal ip and port
I need help urgent with direct examples, not with words.
As of being working with FreeBSD since version 4.2 I'm ok with pf(packet filter), but now I got a project to make a module for web panel for ...
2
votes
1
answer
2k
views
Is it possible to translate a public IP to private IP using iptables?
I a bunch of hosts in the cloud with private and public IPs. Until now, I could access all the hosts publicly and any way I want. Now, I want to disable some access to all of these hosts from the ...
2
votes
4
answers
3k
views
How to change dst ip after routing
How to change destination IP address after routing decision was made, i.e. in POSTROUTING chain of iptables?
0
votes
1
answer
385
views
ip6tables rule to allow unrecognized next-header
I have a compliance test that is requiring my node to respond to unrecognized next-headers per RFC 2460. I am running a debian 3.16 kernel. My current firewall implementation is dropping these frames ...
0
votes
1
answer
1k
views
OpenVPN - client sees the server AND the LAN, but not the Internet
I have the following OpenVPN setup:
Client(android OpenVPN client) <-> internet <-> VPN server (linux) <-> LAN
VPN server has eth0 (visible on the open internet) and eth1 (part of ...
3
votes
1
answer
2k
views
Auto-ban IP from "wp-login.php" attackers
When I look at my Apache log other_vhosts_access.log, I see many many attempts, from a few different IP per month like this:
www.example.com:80 91.200.x.x - - [25/Jun/2017:17:20:19 +0200] "POST /wp-...
0
votes
1
answer
46
views
adding more ips to be allowed on iptables rule
I have this rule in my iptables
target prot opt source destination
DROP tcp -- !10.0.0.61 anywhere tcp dpt:sip
DROP tcp -- !c-74-70-17-69.hsd1.co....
-3
votes
1
answer
3k
views
How to open port 8080?
I have dav server running on port 8080 and when I try to open over browser it is loading and loading.
OS: Ubuntu server 16.04
Just to test if everyrthing is ok with dav server I have tried to flush ...
1
vote
1
answer
191
views
Can IPtables (possibly with libnetfilter_queue library) do everything that snort does?
I have just started getting into network security, firewall, etc. So, please excuse me for asking this basic question.
I looked at IPtables and got a good hang of it (nowhere close to becoming an ...
0
votes
2
answers
111
views
Remove IPTables Rule after 24 hours
I wish to add a rule to iptables, and have it automatically removed after 24 hours.
Is there an easy way of accomplishing this?
Thanks
0
votes
0
answers
239
views
Can't Close Port 21
I have this strange issue where I can't close port 21. I'm using Digital Ocean running Debian Stretch 9. I run nmap against my domain and it shows port 21 is open.
For reference the domain is: https:/...
15
votes
4
answers
26k
views
Once I set iptables to reroute a port, how do I undo it?
I've been reading on many sites how to use iptables to reroute one port to another in Linux. For instance, rerouting port 80 to 8080 would look like this...
iptables -t nat -A PREROUTING -p tcp --...
-1
votes
3
answers
17k
views
CentOS 6 and PostgreSQL - Can't Connect to Port
SOLUTION: it turns out the ORDER of iptables matters. The firth INPUT rule is REJECT all ... which precludes the ACCEPT rule. So I had to use iptables -I INPUT 5 ... to add the rule in the fifth place,...
-1
votes
1
answer
3k
views
iptables ACCEPT for one user [closed]
serverFault.
I'm trying to make 'specific' Wi-Fi/Server now, but I'm encountered a problem.
This iptables config doesn't work properly:
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ...
1
vote
1
answer
2k
views
SNMP port forwarding one way
I would like to forward snmp from one LAN to another LAN. I believe I got one way working (from outside to inside), but sadly the box1 cannot seem to reply. (inside to outside)
The setup I would like ...
0
votes
1
answer
1k
views
IPTables: Redirect Requests From Host Machine to Docker Container in a Virtual Machine
First, let me explain my setup: I have Ubuntu 14.04 installed in a virtual machine on a macOS. In the VirtualBox settings, I created a NAT network and I gave Ubuntu this IP address: 192.168.56.101. ...
0
votes
1
answer
117
views
How to configure Firewall/NAT properly
I am trying to set up KVM virtual machine by following this tutorial:
https://sandilands.info/sgordon/linux-servers-as-kvm-virtual-machines
I cant get Firewall/NAT configured properly. Ip 192.168.1....
-1
votes
1
answer
98
views
Can't transfer anything with FTP [duplicate]
I cant send or receive anything after connecting to FTP, but can remove files. I know that I didn't do a 'good job' with the iptables and now I need help.
Here is the output from iptables -L -n -v
...
0
votes
1
answer
720
views
filter with iptables incoming fraffic from VPN
I have set up a VPN to a private service provider via OpenVPN.
This setup is using the VPN as default gateway.
It all works fine but when I try to apply some basic iptables rules to filter traffic in ...
8
votes
2
answers
7k
views
Is it possible to duplicate a UDP unicast stream with iptables?
I have a proprietary system which transmit a udp video stream from unit #1 (192.168.1.1) to unit #2 (.1.2). I can't make changes to this system, and I'm trying to clone this udp stream so I can access ...
2
votes
1
answer
4k
views
UFW settings on Ubuntu 16.04 serving a MySQL database to a few web servers
I am setting up an Ubuntu 16.04 server that will be used exclusively for incoming and outgoing MySQL database requests to/from some web servers.
Using UFW I am wondering if I could block everything ...
4
votes
2
answers
13k
views
IP Table, what does this construct mean ::INPUT ACCEPT [0:0]
I am looking at an IP Table construct, what does the following mean :
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
thanks
0
votes
1
answer
1k
views
Opening port with IP tables and UFW doesn't appear to open port
I have attempted to open port 443 on a server I'm working on (Ubuntu 16.04):
/sbin/iptables -I INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
The port doesn't appear to be open:
...
1
vote
1
answer
598
views
How to hijack traffic to a port using iptables
I have an application listening on port 2000. I want to proxy all traffic to this port (originating locally) to a different port, say 4000.
Right now i am doing something like this.
iptables -t nat -...
1
vote
1
answer
431
views
Accessing eth0 device via device on wlan0
I have set up a private network at work using a rasperry pi as the wireless access point. All of my wireless devices are able to connect to the network and communicate (via wlan0), however I have a ...
3
votes
2
answers
12k
views
How to setup OpenVPN server to work like a proxy
I'm trying to setup openvpn on Amazon EC2.
To check it I'm using http://whatismyipaddress.com.
Currently I can connect to my remote server with:
sudo openvpn --config /etc/openvpn/openvpnuser1.conf
...
0
votes
1
answer
2k
views
Forward FTP traffic to a local sever through iptables
I have a load balanced infrastructure which has an edge server as the load balancer and some web servers as backend servers and a cpanel server which is my ftp server. I want to forward ftp traffic ...
1
vote
0
answers
945
views
How to route all traffic through another server at the same subnet?
I want to forward all traffic that comes from clients (192.168.1.0/24) out of openwrt gateway (0.0.0.0/0) to the Server openvpn tunnel.
Server has an openvpn tunnel. It has also set options:
...
1
vote
1
answer
856
views
Disable SuSEfirewall2 on boot
I am using an ancient version of SuSe (SuSe 10.2). I have turned off SuSEfirewall2 by running this command:
SuSEfirewall2 stop
That definitely stopped iptables. Is there a way to disable iptables on ...
1
vote
1
answer
45
views
Why is iptable necessary if i can trust my server installation? [duplicate]
I'm trying to get i bit more into security's best practices for my personal knowledge.
Actually i'm not able to understand the necessity of configuring a Firewall like iptable if i can trust my ...
1
vote
3
answers
5k
views
How to remove all rules referring to a chain in iptables?
I have a set of scripts I designed for network monitoring, control and so on. One thing I do in these scripts is create an iptables chain like iptables -N mychain. I then insert rules into the main ...
-1
votes
1
answer
2k
views
sending HTTPS traffic after Squid+SSL_BUMP to a second proxy
After configuring Squid to perform SSL Bump on HTTPS SSL requests from clients..i want to send this to another proxy that will perform its own MITM and connect to the 'target Server' and return back ...
4
votes
2
answers
6k
views
Passive FTP not working properly
I've been having a problem with configuring vsftpd. I have managed to get active FTPS working fine, but passive is being stubborn. I think the problem is with how iptables is managing ports. When I ...
1
vote
1
answer
2k
views
iptables log url query string
I log and drop packets send to specific IP/domain name. I would like to be able to log url parameters for these dropped packet.
This is an example url:
http://somedomain.com/test.php?param1=test1&...