Convert 2 iptables rules to ufw

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
Trapper
Level 4
Level 4
Posts: 353
Joined: Sat Dec 03, 2011 12:21 pm
Location: North Port, Florida USA

Convert 2 iptables rules to ufw

Post by Trapper »

I have a couple of rules I need to insert into UFW but both are in iptables format and I cannot figure out how to convert to UFW format and where I need to put them. If someone could help me with this I would really appreciate it. Here are the 2 iptables rules:

Code: Select all


iptables -t mangle -A PREROUTING -i eno1 -m conntrack --ctstate NEW -j CONNMARK --set-mark 1234

iptables -t mangle -A OUTPUT -m connmark --mark 1234 -j MARK --set-mark 4321

Thank you!

User avatar
WharfRat
Level 21
Level 21
Posts: 13827
Joined: Thu Apr 07, 2011 8:15 pm

Re: Convert 2 iptables rules to ufw

Post by WharfRat »

According to ufw-framework custom rules should be added to /etc/ufw/before.rules after the filter section so this should do it.

Code: Select all

*mangle
PREROUTING ACCEPT [0:0]
-A PREROUTING -i eno1 -m conntrack --ctstate NEW -j CONNMARK --set-mark 1234
OUTPUT ACCEPT [0:0]
-A OUTPUT -m connmark --mark 1234 -j MARK --set-mark 4321
COMMIT
Can I ask what this is attempting to accomplish :?:
ImageImage

Post Reply

Return to “Other networking topics”