Questions tagged [netfilter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

How set MAC address filtering on linux?

I need to block any incoming connection from a MAC address different from a specific one (which is static and well known). This MAC address should generate only non-IP connection: this is the reason ...
0
votes
1answer
155 views

Debian update to Buster, iptables throwing an error in

I've just updated my old Debian Jessie server to Buster, and I'm having some issues with iptables. I understand that the backend has been changed with the update, but I have absolutely no knowledge or ...
0
votes
1answer
14 views

netfilter fails to properly replace destination IP of UDP response package

We have small kuberentes cluster running (CentOS 7, Kuberenetes 1.13 + Flannel) and after some tweaking TCP configuration (see below), we noticed that DNS was not working properly. I don't think that ...
1
vote
1answer
110 views

Check whether iptables or nftables are in use

Given a host that is in an unknown state of configuration, I would like to know if there is an effective way of non-interactively determining if the firewall rule set in place is managed by iptables ...
0
votes
1answer
27 views

How is netfilter able to track the out-of-band data-connections of FTP to be in RELATED state with control-connection?

An article at this URI https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sect-security_guide-firewalls-iptables_and_connection_tracking RELATED — A packet ...
0
votes
0answers
43 views

Why my system can only do port forwarding when I ssh to it?

I use debian 10 with kernel 4.19 and nftables as port forwarding tool. The rule is like table ip nat { chain prerouting { type nat hook prerouting priority -100; policy accept; ip ...
0
votes
0answers
60 views

How to drop all lldp packets on a specific port using IPTables?

I have lldp packets sent on a specific port (6633) and i need to drop only and only if they are lldp packets, because i have another traffic that cant be dropped, so i can't just drop all traffic on ...
0
votes
0answers
27 views

How ipset timeout works?

Is the expiry checked for every received packet if the ip should be removed from ipset or is there something in the background running every second and removing expired ip addresses?
0
votes
0answers
58 views

firewalld updating ipset entry timeout

I have been trying to figure out how to update the timeout of an ipset entry, with no luck so far, when using native ipset I would just simply use: $ ipset add foo 192.168.0.5 timout N -exist but ...
1
vote
1answer
140 views

Does upset hash:net,port support 0.0.0.0/0

Is there a way to add 0.0.0.0/0 to ipset type hash:net,port? It appears to only support prefix lengths of 1-32 but what if I want an entry in my ipset hash to support all ip traffic on a given port? ...
1
vote
0answers
65 views

Netfilter bypass through Firejail

For isolation, I run Firefox through Xephyr with Openbox. In the Firejail profile, I set net enp2a1 to isolate the network through network namespaces. But I don’t like that a regular user can override ...
1
vote
1answer
24 views

Is it possible to bind to a port that has a entry for DNAT in iptables?

I have added a DNAT entry (in the host) for a port (say 30001) in PREROUTING using iptables $ sudo iptables -t nat -A PREROUTING -p tcp --dport 30001 -j DNAT --to-destination <my guest vm ip>:...
0
votes
0answers
19 views

Use Netfilter to programatically set packet destination and route them

I'm new to iptables and its modules and I would like help in rapping my head around it. The Problem Managing large scale NAT routing. I need to handle more then 100,000 static IPs (and growing) and ...
1
vote
0answers
46 views

How does Linux route packets destined for another interface? [duplicate]

How are packets routed inside a single linux machine? Imagine the following setup: +--------------------+ | apache on | | 192.168.1.30:80 | | | | ...
0
votes
0answers
120 views

List all registered netfilter hooks, even those not registered by iptables of nftables

As far as I understand, kernel modules can register a handler function to the netfilter hooks using nf_register_net_hook(), from Digital Ocean: A Deep Dive into Iptables and Netfilter Architecture. Q:...
0
votes
1answer
33 views

Iptable order of rules with example

I had question about IPtables. Let's start with this example of my book: What rules you would set for a mail server accepting connections for EMSTP (port 465) and IMAP (port 993) having a ...
1
vote
1answer
163 views

Example command to set same DSCP value in the IP header for return packets within the same TCP connection

I have seen connmark or ctinfo could work for this but couldn't find a simple effective command to make it work (Not familiar within this area). The command can be applied to the TCP termination node ...
-1
votes
1answer
164 views

Failing service during boot, which one + solution?

System: Linux Mint 19.3 "Tricia" - Cinnamon (64-bit), based on Ubuntu 18.04, kernel 5.3.0-24-generic Problem duration: literally for a year or so. Problem description: since I have too large a ...
1
vote
0answers
99 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 ...
1
vote
1answer
213 views

How to clone the output of the MASQUERADE target with a TEE?

The Netfilter's extensions man page states that: MASQUERADE: This target is only valid in the nat table, in the POSTROUTING chain QUESTION: How to clone the output of the MASQUERADE target with a ...
0
votes
0answers
63 views

why iptables has 5 tables

Recently, I'm reading Linux Kernel Networking. It says Netfilter has 5 mount points, that is pre_routing, post_routing, local_in, local_out and forward. iptables has 5 tables, mangle, nat, filter, ...
1
vote
1answer
838 views

nftables meter error: syntax error, unexpected saddr, expecting comma or '}'

I have below nftable rule to add a connection rate meter: nft add rule ip filter input tcp dport @rate_limit meter syn4-meter \{ ip saddr . tcp dport timeout 5m limit rate 20/minute \} counter ...
0
votes
1answer
147 views

Systemtap can not resolve probe point although it is shown in probe list

I'm trying to debug netfilter synproxy module with systemtap. This is probe point I'm trying to add. # stap -l 'module("ipt_SYNPROXY").statement("*")' | grep send_client_synack module("ipt_SYNPROXY")...
4
votes
1answer
3k views

nftables rule: No such file or directory error

I am trying to apply below nftables rule which I adopted from this guide: nft add rule filter INPUT tcp flags != syn counter drop somehow this is ending up with: Error: Could not process rule: No ...
1
vote
1answer
2k views

Best way to filter/limit ARP packets on embedded Linux

I have an embedded Linux on some network device. Because this device is pretty important I have to make many network tests (I have a separate device for that). These tests include flooding my device ...
0
votes
1answer
2k views

Changing Destination IP address using iptables and DNAT

I am trying to experiment with DNAT in PREROUTING. I found a tutorial here. It contains the following sentence: This is done in the PREROUTING chain, just as the packet comes in; this means that ...
1
vote
1answer
1k 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
0answers
163 views

Packet traversal in the Linux networking stack

I am trying to understand the packet traversal in Linux. I found a diagram from link. My linux box has the following routing table: default via 192.168.2.1 dev wlan0 proto static metric 1024 169....
2
votes
2answers
885 views

How can I transform UDP to TCP with netfilter?

I have a wonderful ISP blocking all UDP traffic (except DNS to its own DNS servers). However, I want to use UDP for my VPN solution. I have root over both VPN endpoints, and both of them are using ...
0
votes
1answer
605 views

Is there any way to view nfmark like ctmark?

I understand that iptables --set-mark does not add mark "on" the packets. The MARK target is for associating a mark with the packet in the kernel data structures. The packet itself is not modified. ...
2
votes
1answer
5k views

How does iptable work with linux bridge?

Setup: VM1 --- Bridge -- VM2 VM1 and 2 are on same subnet. Bridge has 2 interfaces added to brctl bridge. When I block VM2 ip using uptables -A FORWARD -s (VM1 ip) -j DENY it doesn't work. I ...
6
votes
0answers
233 views

Multicast ICMPv6 comes back with conntrack state invalid

I was playing arround with the Multicast feature of IPv6. $ ping ff02::2%wlp3s0 This should normally result in an echo-reply from all the routers on your local network segment (Wikipedia - IPv6). So ...
1
vote
1answer
108 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 ...
1
vote
1answer
252 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
2k 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 ...
2
votes
1answer
662 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 ...
2
votes
1answer
160 views

Packet meta class applied, but captured VLAN priority is wrong

My linux home router sits between my ISP (Orange) and my home network. On the WAN side, Orange provide internet in a VLAN tagged 832. Some control messages (ARP, DHCP, ICMPv6 "router discovery" types,...
1
vote
1answer
130 views

How does one use tc to add latency to a ratelimit?

I read that there's another tool for netfilter that allows you to add latency to a ratelimit. Does anyone have an example of this?
4
votes
1answer
7k views

How --set-mark option works on Netfilter (IPTABLES)?

On Netfilter, you have the option --set-mark for packets that pass through the mangle table. The majority of tutorials and examples over the Internet, say that this just adds a mark on the packet, ...
5
votes
2answers
2k views

Is there a way to do layer 7 filtering in Linux?

The L7-filter project appears to be 15 years old, requires kernel patches with no support for kernels past version 2.6, and most of the pattern files it has appear to have been written in 2003. ...
2
votes
1answer
1k views

multicast traffic is able to poke a hole into the netfilter connection tracking system

I have an IPTV solution at home where the ISP sends me hundreds of large UDP datagrams per second from 10.4.4.5 port 10 to 239.3.5.3 port 10, i.e. it is using multicast. My current iptables ...
1
vote
2answers
614 views

Send TCP packet to the same source [closed]

I want to design a system which reduce travel time of packet what is happening in reality is I send a SYN bit from client side, this bit travel through router then to server and server reply SYN+ACK ...
1
vote
0answers
418 views

iptables connlimit-above allowing more connections than desired

I'm trying to set a per-ip connection limit on a kubernetes node using iptables connlimit. Since each container on the VM has a different source IP (overlay net), using connlimit should work. I added ...
7
votes
2answers
5k views

What are the essential iptables rules for IPv6 to work properly?

I had a problem where I lost connectivity to a server on the IPv6 address after some time and it turned out to be caused by DHCPv6 client packets (port 546) being dropped by the default INPUT policy ...
0
votes
0answers
144 views

When are inverse NAT manipulation applied by netfilter/iptables?

If there is a DNAT rule in the PREROUTING chain like this one: iptables -t nat -A PREROUTING -j DNAT --to-destination x.x.x.x All packets reaching the stack from a network interface will first pass ...
1
vote
2answers
913 views

How to establish a man-in-the-middle scenario with ebtables and iptables

For testing and educational purposes I want so set up a man-in-the-middle scenario as follows: Host T is the target host that is to be "cloned" Host M is the man in the middle with interfaces eth0 ...
3
votes
1answer
3k views

How to match both UDP and TCP for given ports in one line with nftables

How can i do this in a single line? tcp dport 53 counter accept comment "accept DNS" udp dport 53 counter accept comment "accept DNS"
0
votes
1answer
668 views

nftables, add output rule syntax

I'm a bit frustrated by the lack of comprehensive documentation of nftables and currently I'm failing to get even a simple example to work. I'm trying just create a output rule. Here's my only table: ...
0
votes
1answer
5k views

URL Filtering with IP tables

I've been trying to set up URL filtering with Iptables. I have set up two interfaces. Traffic flows in from one interface and flows out from the other. Below are the Iptables I have configured: *...
0
votes
1answer
1k views

blocking YouTube not working for Google Chrome

I have some rules on the FILTER table of Netfilter, which block HTTPS access to some websites: -A FORWARD -s 10.255.255.0/26 -p tcp -m tcp --dport 443 -m string --string "facebook.com" --algo bm -j ...