iptables

How to define port forwarding

How to define port forwarding I run a server with a web server running as a rootless podman container. This exposes ports 10080 and 10443 because, as a rootless container, it is not allowed to expose ports 80 and 443. So that my website can be accessed from outside, I use ufw as a firewall …

Total answers: 1

iptables allow host for isolated VLAN

iptables allow host for isolated VLAN I’m having a real trouble trying to do a "simple" tweak in my network. So: there are two sites, A and B and are connected via IPsec and there’s no problem in communication between them. each site has two VLANs, main and guest: main is 192.168.55.0/24 for A and …

Total answers: 1

Iptables, subnet rule overwriting ip rule

Iptables, subnet rule overwriting ip rule I want to DROP all packet that come from the subnet 192.168.112.0/24 with destination 192.168.112.0/24 but I want to allow only a specific destination to be accessible (192.168.112.253). I am using the following rules, the first (DROP) rule is working as expected dropping all packets but the second (ACCEPT) …

Total answers: 2

UFW Couldn't determine iptables version

UFW Couldn't determine iptables version I am building a custom embedded Linux platform based on the NXP i.MX8 with Yocto. I want to use UFW to setup the firewall. When I boot the system and try to use UFW it returns an error Couldn’t determine iptables version. I have the iptables and nftables packages installed. …

Total answers: 1

Route traffic from one IP address through a different interface

Route traffic from one IP address through a different interface I have a local and a remote network. My local network has a router, ubuntu box and TV. The remote network has a router and a raspberry pi. The local ubuntu box and remote raspberry pi are connected through a wireguard tunnel. The goal is …

Total answers: 1

Dedicated network interface for OpenVPN

Dedicated network interface for OpenVPN I’m trying to use an OpenVPN client service to serve a vpn connection over specific application. In my case I want to setup my tor and only tor connection to go over vpn. Should How would I achieve this? I tried to add a link with ip link add, including …

Total answers: 1

nftables does not limit ipv6 traffic in rate limit rule in bridge and ip6 family

nftables does not limit ipv6 traffic in rate limit rule in bridge and ip6 family I have a wifi router where the wlan0 interface (radio interface) is bridged with the ethernet interface eth0 (connected to another server acting as DHCP) / # brctl show br0 bridge name bridge id STP enabled interfaces br0 8000.bce67c4d8fb0 no …

Total answers: 1

How i can change ping (icmp) packet size by iptables in VPS?

How i can change ping (icmp) packet size by iptables in VPS? How i can change ping (icmp) packet size from default (64 byte) to 1 byte with iptables for both VPS input and output ping to specific IP in VPS? I executed this command but when I get ping again 64 bytes sent for …

Total answers: 1

Understanding packet flow through iptables rules for docker container bridge network?

Understanding packet flow through iptables rules for docker container bridge network? Background I want to understand the relationships between docker container networks and iptables, and generally understand how packets flow from the eth0 interface (in a container), through the default bridge docker0 interface, and to the network interface on the host computer. At the moment, …

Total answers: 1

How to police ingress (input) packets belonging to a cgroup with iptables and tc?

How to police ingress (input) packets belonging to a cgroup with iptables and tc? I am trying to limit the download (ingress) rate for a certain app within a cgroup. I was able to limit the upload (egress) rate successfully by marking app’s OUTPUT packets in iptables and then set a tc filter to handle …

Total answers: 1

How to mark packets by program

How to mark packets by program How to mark all packets (inbound and outbound) for specific program/ cmd in Linux using iptables or any other firewall/ tool Given that –cmd-owner option was deprecated ref:http://www.spinics.net/lists/netfilter/msg49716.html. For example, how to mark all Firefox’s packets, knowing that Firefox can spawn processes so the PID option isn’t feasible. Asked …

Total answers: 1

How to view iptables rules after deleting the package?

How to view iptables rules after deleting the package? If someone has ran sudo apt remove iptables -y on a server, is there a way to recover the rules that were being used? I’ve looked for /etc/sysconfig/iptables and /etc/iptables, but neither of the directories exist. Asked By: ajmeese7 || Source That package contains neither rules …

Total answers: 1

Can not block torrent traffic in my Ubuntu 22.04 vps

Can not block torrent traffic in my Ubuntu 22.04 vps I have an Ubuntu 22.04 vps which I want to block all torrent traffic on it. I tried Iptables by this commands : iptables -I FORWARD -m string –algo bm –string "BitTorrent" -j DROP iptables -I FORWARD -m string –algo bm –string "BitTorrent protocol" -j …

Total answers: 1

Why the ID of iptables trace records is zero?

Why the ID of iptables trace records is zero? I used iptables trace to analysis an network problem, but the ID of records of ACK packets was always zero: [ 3556.086666] TRACE: raw:OUTPUT:policy:2 IN= OUT=lo SRC=10.233.52.186 DST=10.233.52.186 ID=51512 PROTO=TCP SPT=54186 DPT=80 SYN [ 3556.086772] TRACE: nat:OUTPUT:rule:1 IN= OUT=lo SRC=10.233.52.186 DST=10.233.52.186 ID=51512 PROTO=TCP SPT=54186 DPT=80 SYN …

Total answers: 1

routing table configured with "ip route" part of the "iptables"?

routing table configured with "ip route" part of the "iptables"? This question is frequent and has already a lot of answers, but I still don’t get it. Is the routing configured with "ip route add .." part of the iptables flow? Is the "routing decision" like in the following picture the routing table configured with …

Total answers: 1

How does firewalld handle packet state internally when you add rules?

How does firewalld handle packet state internally when you add rules? Coming from an iptables background, I can specify packet connection states (usually either NEW and/or ESTABLISHED) when defining new firewall rules. For example, this pair of rules will ensure that http connections will only be allowed when initiated by my host and dropped when …

Total answers: 2

When sport or dport is used on INPUT of Iptables?

When sport or dport is used on INPUT of Iptables? I want to block port 22 to users on my local network. My linux server controls the traffic with iptables. Which rules are the most appropriate? iptables -A INPUT -i $LAN -p tcp –sport 22 -j DROP or iptables -A INPUT -i $LAN -p tcp …

Total answers: 2

My Postfix submission service cannot be accessed remotely

My Postfix submission service cannot be accessed remotely I have a Postfix server that is working on port 25 (SMTP). I can use Thunderbird to send mails through this Postfix server. I followed these documentations: http://www.postfix.org/SASL_README.html#auxprop_sasldb https://wiki.debian.org/PostfixAndSASL#Using_auxprop_with_sasldb It’s easy to configure: $ sudo apt install libsasl2-modules sasl2-bin $ sudo saslpasswd2 -c -u example.com yugiohjcj $ …

Total answers: 1

Packets from tun interface not being logged by iptables

Packets from tun interface not being logged by iptables On Ubuntu 22.04, I’ve set up the following iptables rules: iptables -I OUTPUT -d 192.168.0.0/16 -j LOG –log-prefix "CHECK1 " iptables -I FORWARD -d 192.168.0.0/16 -j LOG –log-prefix "CHECK2 " Just to verify that I set things up correctly, I navigated to website.com (which is in …

Total answers: 1

How to configure Firewalld to block incoming traffic on loopback interface?

How to configure Firewalld to block incoming traffic on loopback interface? I have firewalld enabled and configured as below: loopback (active) target: DROP icmp-block-inversion: no interfaces: lo sources: services: ports: protocols: forward: no masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: rule family="ipv4" source address="127.0.0.0/8" port port="8080" protocol="tcp" drop rule family="ipv4" destination address="127.0.0.1" port port="8080" protocol="tcp" …

Total answers: 1