Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[IDEA] Dynamic priority process
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Idea: Dynamic priority process
13th Aug, 2013, 02:36 AM
Post: #20
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Dynamic priority process
(13th Aug, 2013 01:35 AM)belese Wrote:  after search, i've read it's not possible,
the work around i've seen (and if i understand you, is what you explain),
is to use LOG in iptables, and the daemon read log file, and when specific log is writed, react on this.
this is what you explain, right?

fo netfilter, no sure iv'e understand, only thing i need is tcp (maybe udp) socket state changed.

yes, LOG to rsyslog and rsyslog to socket. no polling. LOG is writing to syslog via 514/tcp/udp so if you don't use it, you can bind directly on 514 and just wait - never tried parsing 514/syslog tcp communication.

but for this CONNECT / LISTEN Smile, just create rule to dup packet. one will go to original destination, second to you bind port Wink

iptables -A PREROUTING -t mangle -j TEE -m state --state ESTABLISHED -p tcp --dport XX --gateway 127.0.0.1

(will copy & forward packet to 127.0.0.1, which was part of established connection to your box on port XX)

based on actual rate / bandwidth you could change the priority in more steps... somehow I though you want this.

but when I'm thinking, the easy effective - whole daemon

Code:
conntrack -E -e NEW,DESTROY -p tcp --dport 22 | \
while read line; do  
   case $line in
     *NEW*)
        initctl emit -n NEW_CONNECTION_priority_high
        ;;
     *DESTROY*)
        initctl emit -n CLOSED_CONNECTION_EXPIRED_priority_low
        ;;
    esac
done

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Dynamic priority process - belese - 13th Jul, 2013, 12:25 AM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 01:00 AM
RE: Dynamic priority process - belese - 13th Jul, 2013, 01:11 AM
RE: Dynamic priority process - mk01 - 18th Jul, 2013, 05:10 AM
Re: Dynamic priority process - f1vefour - 13th Jul, 2013, 07:44 AM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 07:57 AM
RE: Dynamic priority process - belese - 13th Jul, 2013, 07:09 PM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 08:57 PM
RE: Dynamic priority process - mk01 - 17th Jul, 2013, 05:52 AM
RE: Dynamic priority process - belese - 17th Jul, 2013, 07:33 PM
RE: Dynamic priority process - belese - 18th Jul, 2013, 09:32 AM
RE: Dynamic priority process - mk01 - 19th Jul, 2013, 06:42 AM
RE: Dynamic priority process - belese - 18th Jul, 2013, 10:40 PM
RE: Dynamic priority process - belese - 25th Jul, 2013, 05:58 AM
RE: Dynamic priority process - CurlyMo - 25th Jul, 2013, 08:25 AM
RE: Dynamic priority process - belese - 25th Jul, 2013, 06:32 PM
RE: Dynamic priority process - belese - 26th Jul, 2013, 11:17 PM
RE: Dynamic priority process - mk01 - 12th Aug, 2013, 04:02 PM
RE: Dynamic priority process - belese - 13th Aug, 2013, 01:35 AM
RE: Dynamic priority process - mk01 - 13th Aug, 2013 02:36 AM
RE: Dynamic priority process - belese - 14th Aug, 2013, 02:47 AM
RE: Dynamic priority process - mk01 - 14th Aug, 2013, 03:37 AM
RE: Dynamic priority process - belese - 14th Aug, 2013, 05:19 AM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 25th May, 2025, 07:27 AM Powered By MyBB, © 2002-2025 MyBB Group.