LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-25-2019, 07:13 PM   #1
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Rep: Reputation: 32
How to action based on marked package in iptables?


Hi.

How to action based on marked package or connection in iptables?

Just a simple example:
iptables -t mangle -A PREROUTING -p tcp --dport 22 -j MARK --set-mark 2

This would mark 2 for port 22 destination

My question is:
How to do an action based on mark? From the above scenario, how to drop package based on mark 2?

Need advise

Thanks
 
Old 04-26-2019, 05:53 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
See the description of the mark and connmark extensions in the iptables man page.

Also see the Linux Advanced Routing and Traffic Control HOWTO.

Last edited by berndbausch; 04-26-2019 at 05:55 PM.
 
Old 04-29-2019, 03:14 PM   #3
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Just a mark or label, not relative to any destination port.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
[SOLVED] Every two minutes rsyslog outputs - rsyslogd: action 'action 3' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 Toadman Linux - Software 9 09-01-2018 12:41 PM
php form action : second action ?? esteeven Programming 7 05-08-2015 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration