Questions tagged [iptables-persistent]
The iptables-persistent tag has no summary.
37 questions
2
votes
1
answer
877
views
Why was UFW removed automatically?
I noticed that the package UFW had been removed from a server, but do not recall having manually removed it. Looking at the logs at /var/log/apt/history.log, I noticed this entry:
Start-Date: 2024-06-...
0
votes
2
answers
3k
views
cannot get iptables to auto load rules on reboot with iptables-persistent
I need some help, or advice.
I have a latest server I am trying to get into production and I cannot get it to load its rules on a reboot.
"Debian GNU/Linux 10 (buster)" it is up to date in ...
0
votes
1
answer
797
views
How can I copy all traffic on a network and forward it to another IP address?
I'm trying to use iptables.
I'm simulating a network with Mininet. I currently have a router connecting two subnets (10.0.1.1/24 and 10.0.2.1/24). If I use these two iptables rules on the router I see ...
0
votes
1
answer
884
views
Iptables Accept All From Specific Ip And Port
I want to accept all traffic that is coming from an IP address and its specific port to any of my ports.
Here is the configuration:
Details:
I am using Jitsi in a server, and I want to reach Jitsi ...
0
votes
3
answers
369
views
Blocking internet of an DHCP assigned static IP, but allowing internal LAN network to get to device
I have a Rasberry Pi that DHCP assigns a static IP address (Based on it's MAC address) at 192.168.2.12 with the Local gateway at 192.168.2.1, I want to block internet traffic to it and from it, but I ...
0
votes
0
answers
141
views
Something is modifying my iptable, can it be traced?
I've got the following command in my iptable: -A FORWARD -o enp0s3 -j ACCEPT
That somebody doesn't like, because after 2 reboots, it's gone from the iptable...
I've got iptables-persistent
installed, ...
1
vote
1
answer
5k
views
Can UFW work with iptables-persistent?
I used a script to set up iptables rules and then made them persistent with iptables-persistant. This is described here as a means to prevent a certain user sending traffic over eth0 so it can just ...
1
vote
1
answer
569
views
Debian10 iptables-restore [legacy] just fails with simplest rule
I'm trying to set up a simple firewall with docker and I wanted to use iptables-restore. I changed the iptables used to legacy (so shouldn't use nftables if I'm right).
The problem is that even a file ...
0
votes
1
answer
423
views
Ubuntu 18.04 Server Internal and External network configuration
I have issue in Ubuntu 18.04 Server to configurate internal and external network. Case is that i have Gateway device which has DHCP service to lease IP addresses for wlan connected devices. Gateway ...
2
votes
0
answers
544
views
arptables-nft persistence
Introduction
This is on Debian Buster with kernel 4.19.0-6
I've installed iptables-persistent and netfilter-persistent versions 1.0.11
and added a basic rule to arptables-nft to block all LAN ...
0
votes
2
answers
235
views
Default configuration iptables, how to avoid to be blocked when flushing tables?
I have this base for iptables when I have a new server to configure :
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -...
3
votes
2
answers
4k
views
Force iptables to immediately put drop rule into effect
I have the following setup: in /etc/iptables/rules.v4
# Generated by iptables-save v1.4.21 on Mon Jul 1 11:32:00 2019
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [3:620]
-A ...
1
vote
2
answers
4k
views
How to get UFW to read current iptables rules after modification? (Ubuntu)
I am adding a chain using iptables:
iptables -N ETDROP
When I reboot, this is lost.
I read of many ways to make iptables rules permanent... however
You must remember, I am using UFW and UFW has ...
6
votes
1
answer
5k
views
How to save only specific iptables chains?
I need to configure iptables on a linux machine with running docker containers. If I save iptables rules with iptables-save > /etc/iptables/rules.v4, rules from all chains will be written to file.
...
1
vote
1
answer
3k
views
iptables-restore failed in Debian buster/sid if it has --multiport option in the rules file
I have /etc/iptables/rule.v4 file contains many rule, the below is the line where I see the issue
-A INPUT -p tcp -m multiport --dports 22 -j ACCEPT
-A INPUT -p udp -m multiport --dports 16384:32768 -...
0
votes
1
answer
1k
views
iptables: what happen after a reboot?
Installing NCPA for nagios, I found these instructions
iptables -I INPUT -p tcp --destination-port 5693 -j ACCEPT
apt-get install -y iptables-persistent
Answer yes to saving existing rules
Of course, ...
4
votes
1
answer
2k
views
fail2ban with iptables-persistent
I've been running fail2ban for a bit, and recently installed iptables-persistent and am using it with ipset for a blacklist (there's one particular IP that is always hammering away at this machine). ...
2
votes
1
answer
3k
views
Masquerade rule with netfilter-persistent
I use netfilter-persistent to manage a firewall.
I would like to share a connection between two interfaces using masquerading (example, or another). When I run those operations by invoking iptables ...
1
vote
2
answers
1k
views
Use the LANs of one server to access the LAN of another
I'm a bit lost here, so I'm asking for your help. =D
I have three servers:
1# - LANs A and B
2# - LANs B and C
3# - LANs C and D
How can I make server 1# access through LAN B an ip that is in LAN D ...
1
vote
1
answer
411
views
Running iptables commands on boot (on locked down, IoT device)
I am using a cell modem / router that is running a vendor custom distribution of Linux kernel 3.12.70.
I'd like to add custom iptables rules, but they keep being deleted on reboot.
I've tried https:/...
4
votes
3
answers
6k
views
Persistent iptables
I've just read about iptables-persistent and I'm completely lost w.r.t. the design. I'm not the only one, who didn't understand how it works, but actually it seems to be way beyond my imagination.
I ...
0
votes
0
answers
1k
views
Cannot connect to SSH with iptables firewall enabled
I cannot seem to connect to my VPS even when enabling port 22 on my firewall. I have tried multiple iptables inputs to try and allow SSH to work. This is a debian 9 stretch system with iptables ...
1
vote
0
answers
59
views
Unusual behavior in iptables
I am currently running a xubuntu 16.04.1 VM on VMWare using bridged networking. The end goal is to have only DNS and outgoing HTTP/HTTPS.
Iptables (latest version with iptables-persistent) is ...
0
votes
2
answers
1k
views
Debian 8, ping 127.0.0.1 not working
On my Debian 8 `uname -a' gives:
Linux uname 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux
Tried
route -n gives:
Kernel IP routing table
Destination Gateway ...
2
votes
4
answers
625
views
iptables-persistent blocking any outbound connections
I use iptables-persistent to set firewall rules.
This is my standard configuration:
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp --dport ...
1
vote
2
answers
684
views
Iptables accepts any ip or range in any format
Update Jun 30
I have a list of ips.txt and I want iptables accepts any ip or range in any format. Example:
# IPs List
199.59.243.120
157.60.1.0/24
91.190.0.0/16
192.168.2.1-192.168.2.25
My rule:
for ...
1
vote
1
answer
2k
views
Is it possible to save iptable rules that have a name for destination instead of IP?
For instance, I have the rule
#iptables -A OUTPUT -d www.google.com -j ACCEPT
When I type this rule in a terminal it resolves to the appropriate IPs, and that is what is stored in rules.v4 when I ...
2
votes
1
answer
4k
views
Debian 8 iptables-persistent setup is not correct?
I'm renting a vps with debian 8 on it.
I'm trying to set up my iptables, following this blog:
http://bencane.com/2012/09/iptables-linux-firewall-rules-for-a-basic-web-server/
The problem is that my ...
2
votes
1
answer
6k
views
iptables rule in /etc/rc.local are not loaded
/etc/iptables.conf
contains a rule to dump my outgoing packets to 10.199 network as,
*filter
:INPUT ACCEPT [122:9273]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [73:8165]
-A OUTPUT -d 10.199.48.0/24 -j ...
1
vote
1
answer
4k
views
How can I fix "insserv: There is a loop between service mountnfs and nfs-common if started" in Debian wheezy?
I'm working on a Debian wheezy x64 box, with dist-upgrade to:
Debian 7.7 (wheezy) 64-bit
kernel Linux 3.2.0-4-amd64
It's configured with Linux RAID10, dm-crypt/LUKS and LVM. I've installed VirtualBox ...
0
votes
1
answer
522
views
Connection lost to VPS While using iptables by default policy as DROP for INPUT, OUTPUT, FORWARD
I'am using iptables in many server's but now stuck with this issue while using default Policy as DROP.
Here is my rules which i have used in VPS, Tried many time's everything seems fine but VPS ...
6
votes
3
answers
35k
views
how to make firewall changes permanent via firewall-cmd?
I am trying to open some ports in CentOS 7.
I am able to open a port with the following command:
firewall-cmd --direct --add-rule ipv4 filter IN_public_allow 0 -m tcp -p tcp --dport 7199 -j ACCEPT
...
0
votes
0
answers
3k
views
Upon bootup, all iptables are lost because the kernel module ip_set is not loaded
i can get iptables to whitelist / blacklist using ipset members, but after a reboot, the iptables are emptied out because the kernel module is not loaded. Have limped along in the past by customizing ...
0
votes
1
answer
147
views
how to get effect of IP rules script in RHEL 6?
I have written one ip.sh file in that I have written one rule and then saved the iprules with the corresponding commands. Now when I opened /etc/sysconfig/iptables nothing is reflecting. I need the ...
4
votes
1
answer
3k
views
How to combine iptables rulesets
Say there are several iptables scripts (run at boot time), all of which run something like iptables -A ... to add rules. I'm thinking this could be improved, turning all those shell scripts into text ...
2
votes
2
answers
10k
views
IPtables reset on reboot, how do I tell what is causing this
Using RHEL, and I have had some "Cyber Security" people work on my server. I'm now using this server in a completely closed environment with no outward network connection, and would like my iptables ...
31
votes
4
answers
104k
views
Why isn't the Iptables persistent service saving my changes?
I followed this tutorial to set up IP rules on ubuntu 12.04. Everything worked fine on setup -- but now I've made changes to the firewall that do not persist upon reboot. I do not understand why that ...