Stack Exchange Network

Stack Exchange network consists of 174 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

Questions tagged [iptables]

iptables allow creation of rules to define packet filtering behavior.

0
votes
0answers
8 views

Allow iptables communication only between two clients (mac-addresses)

I have a network with two vlans (vlan 7 and vlan 8). i want to block any communication between this two networks except some client mac addresses. I want to allow one client in vlan 7 to communicate ...
1
vote
1answer
18 views

iptables blocking local traffic

My local machine IP: 192.168.0.35 What I did: Answer that i tried here!! sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.0.35:80 The error: Now I can not access ...
0
votes
1answer
28 views

Is it useful to set the policies to DROP for all tables in Iptables?

I use iptables to secure my server. The default policies for all chains in the filter table have been set to DROP # iptables -t filter -L | grep -i \ (policy Chain INPUT (policy DROP) Chain FORWARD (...
1
vote
1answer
24 views

VMs attached to the same bridge cannot ping each other

I am now trying to host two VMs directly by qemu, without any tools like libvirt. I did setup the bridge/tap interfaces for each of them like ip link add br0 type bridge ip addr add 192.168.122.1/24 ...
0
votes
1answer
36 views

Restrict access to 80 port-access only via OpenVPN

Now I have access from outside to 80 port with ownCloud web interface. But I want to get access to it only via OpenVPN connection. I tried to run: # iptables -I INPUT -i eth0 -p tcp --dport 80 -j ...
0
votes
0answers
34 views

How can you remove the “any any” rule for ssh in iptables?

I try to reduce the allowed connections for ssh via iptables/firewall-cmd. When I list the rules with "iptables -L" it shows me the configured accepted IPs but at the end I have this "any any" rule ...
0
votes
0answers
16 views

Routing table is shared even after calling OS level drop command (DVR Implementation) [closed]

I'm currently working on an assignment. This is an assignment on networking and the topic is dvr (distance vector routing) protocol. I have to complete several features in this assignment. Firstly ...
2
votes
1answer
24 views

Restrict local port access to a specific user

I'm trying to restrict access to a particular port for a particular user on my Debian. Let's say user's id is 1000 and port I would like to block is 5000. I tried using iptables with the following ...
0
votes
1answer
21 views

What is the difference between iptables -S and iptables -L

The help information doesn't seem to be very informative: --list -L [chain [rulenum]] List the rules in a chain or all chains --list-rules -S [chain [rulenum]] Print the rules in a ...
0
votes
1answer
17 views

iptables, vpn server, routing

I set up my server (let's call it server A) firewall so that no input/output rules be allowed, apart from: - incoming ssh conection - outgoing ssh connection This is working well by now! Now, i ...
0
votes
0answers
15 views

How to translate these ufw rules to iptables?

I want to secure my OpenVPN configuration by using a killswitch. I don't know much about networks and firewalls but I found this ufw config which works just fine. ufw default deny outgoing ufw ...
-1
votes
1answer
29 views

How to forbid my PC in LAN to make DNS queries? (in a PC -> VPN gateway scenario)

scenario: i have 2 pc's that are connected to each other over ethernet in a lan and one of the pc's is configured as a gateway that tunnels the traffic of the other pc over to a vpn service. ...
0
votes
0answers
39 views

Debian : Iptables rule not staying persistent, getting deleted in sometime

I am working on a Debian stable system and we want to add a rule to allow access for Nagios. Unfortunately, the rule is automatically getting deleted after some time. We are unable to find out what's ...
0
votes
1answer
24 views

Editing multiple iptables rules

i am using iptables to allow certain IPs(users) to allow specific ports. Like so - ACCEPT tcp -- 1.2.3.4 anywhere tcp dpts:4358:4362 So for each IP address I have multiple ...
1
vote
1answer
23 views

iptables Masquerade leave out some local packet?

In openwrt i have config lan forward to wan with masqenabled. And my lan network is 192.168.100.0/24. when some pc ping with other network ip e.g: 192.168.1.15, tcpdump will get some local packet in ...
1
vote
3answers
38 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 ...
0
votes
0answers
26 views

Adding iptables to yocto causes image do_rootfs to fail

My image builds nicely with kernel 4.13 (set in local.conf) and all of my recipes. When I try to add the iptables recipe (v1.6) to my image, the do_rootfs task fails with the following error: ERROR: ...
1
vote
2answers
42 views

Mac Address filter in IPtables

I have an application on 2001 Port and i want allow some users with mac addresses to connect to this port. so i use this commands : sudo iptables -A INPUT -p tcp --destination-port 2001 -j DROP ...
-1
votes
0answers
67 views

Firewalld fails to start on Debian unstable

I have a server running Debian buster/sid (unstable) on which I installed firewalld. After playing with firewalld for a day, firewalld refuses to start and none of the --permanent rules are loaded. I ...
0
votes
0answers
17 views

Transparently redirect all incoming traffic from wifi hotspot to specific port?

I am using my laptop as a wifi hotspot to share my internet connection with other devices. My internet connection goes out through a socks proxy. In my laptop I configured redsocks to redirect all ...
0
votes
1answer
54 views

Enabling rp_filter loose (#2) mode for IPv6

does anyone have a solution to make reverse path filtering work (in loose mode) also for IPv6 and not only for IPv4? The setup I am having is a machine1 connected directly to a machine2, while ...
0
votes
1answer
43 views

How to limit 1 connection per 5 seconds? (IPTABLES)

I want to limit 1 connect per 5 seconds using IPTABLES for people, which are connecting to port "12871/12881". I was trying to find rule for it, but ineffectively. It must be like a "queue" of ...
0
votes
0answers
28 views

Iptables --update recent module

This is what I have (in short): --update --seconds 60 --hitcount 10 -j DROP Does it mean that the rule will trigger if this hit count is 10 only? But what if the hit count is 9 or 11 will it not ...
1
vote
1answer
40 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). ...
0
votes
0answers
17 views

Throttling SSH with iptable hashlimit - Disconnects Existing Session

OS: Cento 7.5 I am using iptables with hashlimit to throttle SSH connections. Here are the rules: File: /etc/sysconfig/iptables: -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p ...
0
votes
0answers
9 views

Masquerade rule with netfilter-persitent

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 ...
0
votes
0answers
16 views

iptables forwarding incoming IP to another destination IP

server 1.1.1.1 client 2.2.2.2 client: 3.3.3.3 I have a server and two clients, in order to visualize all the trafic in my network from my client 2.2.2.2 i have to forward the trafic between my ...
0
votes
0answers
9 views

If br_netfilter is not loaded, how are Sec Groups and neutron rules for VM affected?

I have an OpenStack cluster (two controllers and 6 compute nodes). On each compute host I have these interfaces: lo eth0 eth1 ovs-system br-int br-ext docker0 vethc8bb391@if9 and a sample VM has: ...
0
votes
0answers
14 views

Redirect port 8888 on zone public to be redirected to same port on zone “external” and IP address 127.0.0.1

I've an application which is running locally on 127.0.0.1 and port 8888 in addition to openvpn which is installed and using eth1 interface The active zones on firewall firewall-cmd: public (...
0
votes
2answers
53 views

Rejecting TCP packets from certain IP on network using iptables

Say I wanted to reject packets that are sent to my computer from a specific IP on the network using iptables. Do I need to define the destination of the packet in my command or is it sufficient to ...
-3
votes
1answer
58 views

How to block bad packets? [closed]

I want to block bad packets. I have used CSF and added them into csfpost.sh... But I really to block these (Flags: SYN ECN CWR) right now, These are my rules.. #!/bin/bash # Drop Various Attacks ...
0
votes
0answers
24 views

Testing if iptables rules working on VirtualBox Linux VM

I have this specific set up I created to test squid cache intercept mode. I have created a VritualBox centos 7 SE linux VM on my mac. Disabled SE linux (set to Permissive) and disabled the firewall ...
0
votes
0answers
13 views

Allow localhost connections with VPN

I have some services running as web servers on my PC (e.g., Jupyter Notebook), which stop working when I connect to my VPN through their app (their support team confirmed that this should be the case)....
1
vote
0answers
36 views

traceroute working but telnet time outs with error 28 [closed]

Previously I was able to telnet to a server , but now I am facing timeout error 28. I tried for traceroute it works and shows hopes . I tried below command curl -v -m 5 telnet://ip:portnum I am ...
0
votes
1answer
54 views

Routing traffic via different interface based on destination

I'm playing with iptables and routing. So I have an Ubuntu machine with 2 interface eth0(192.168.2.100, gw 192.168.2.1) and tun0(10.7.7.2, gw 10.7.7.1). I want traffic to this site ifconfig.me go via ...
0
votes
0answers
9 views

Iptables on Host to manage vmnet

I am having the following configuration Host: Ubuntu 18.04 VM1: Ubuntu 18.04 VM2: Win10 I will like to configure iptables on the host in order to achieve the following: Host will be open to 80 &...
2
votes
0answers
115 views

What is the difference between NFTables and BPFilter? [closed]

I trying to secure my home network with OpenWRT routers. In this context I started to customize my iptables rules to my needs and found some iptables concepts hard to understand. I've discovered ...
0
votes
0answers
32 views

Burp with iptables

I am trying to configure my Kali machine to redirect all local traffic to Burp Proxy using iptables, but something seems to be wrong. This is my current configuration: > sysctl -w net.ipv4....
1
vote
1answer
65 views

How to route outgoing traffic to one IP to another IP?

I currently have a server that's about to go down. I have a deployed application which unfortunately connect to it by IP. How would I proceed if I wanted to run a script on the client machines so ...
0
votes
1answer
39 views

Locally forward tcp port bidirectional

I wonder how it is possible to locally forward a tcp port, bidirectional, i. e. all packets leaving the local machine on port 25 (this port of course is actually dynamically assigned) should be ...
0
votes
0answers
14 views

How to forward packets between two interfaces?

I have ens224 with IP 192.168.1.41 and ‍ensens256 with IP 192.168.1.46 I want incoming traffic from ens224 and output traffic ens256 I use this rule in iptables. echo 1 /proc/sys/net/ipv4/...
0
votes
1answer
23 views

Blocking ports with iptables 1.4.2

I am trying to block some ports on an embeded uClinux· The Iptables version is 1.4.2. The command I used was iptables -I INPUT -p tcp --dport 22 -j DROP But it seems that iptables 1.4.2 is not ...
0
votes
0answers
23 views

Network bridge and disappearing packets after the “mangle” table

TLDR: I setup a system for intercepting packets, and found that while using a network bridge, packets would disappear after the "mangle" table's PREROUTING chain, failing to hit rules in the "nat" ...
0
votes
1answer
28 views

allow windows shares through iptables in debian 9

i'am working on securing my lamp server(debian 9) with iptables. well as you probebly know. the principle is to block all ports and then allow only the ones i need. for the moment i've succeeded on ...
-1
votes
1answer
32 views

Accept Google Translate in my IPTABLES

I want enable the translate.google.com IP. My problem: The translate.google.com IP is changed frequently, see:
0
votes
0answers
27 views

Change destination of TEE'd packets

Because of reasons I can't go into here, I found myself having to duplicate a UDP packet stream (netflow data, if it matters) to a second destination. After some research, I discovered that the TEE ...
0
votes
1answer
52 views

Debian 9 allows hidden DNS queries?

In previous Debian Jessie I could configure iptables to restrict DNS traffic to my own router (192.168.1.1): Chain OUTBOUND (1 references) target prot opt source destination ...
1
vote
2answers
71 views

checking if iptables are set on a system in script [duplicate]

I'm writing a script in bash and I need to check if iptables are set...I have this: if [ `iptables-save | grep '^\-' | wc -l` > 0 ] then echo "Iptables already set, skipping..........!" else ...
0
votes
1answer
224 views

Centos 7 server iptables Active: active (exited)

When I check the iptables service status it says Active (exited) why and how do I fix it?
0
votes
1answer
28 views

Performance of active port - netstat

Below command [root@machine1 output]# netstat -s --udp IcmpMsg: InType0: 371137 InType3: 296 InType8: 386843 InType11: 4 InType13: 141 InType15:...