LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-03-2022, 06:19 AM   #1
radwan1998
LQ Newbie
 
Registered: Feb 2022
Posts: 9
Blog Entries: 1

Rep: Reputation: 0
Redirect traffic to multi desport


Hello,

I have a question I want to redirect traffic from port x and y to 53.

I mean like this

iptables -t nat -A PREROUTING -p udp --dport 53 -m string --algo bm --from 20 --hex-string "|02743107776f726d6e657402657500|" -j REDIRECT --to-ports x, y, z


So Destination port should be 53

Thanks

Last edited by radwan1998; 08-03-2022 at 11:27 AM.
 
Old 08-03-2022, 08:21 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by radwan1998 View Post
Hello,
I have a question I to redirect traffic from port x and y to 53. I mean like this
Code:
iptables -t nat -A PREROUTING -p udp --dport 53   -m string --algo bm --from 20 --hex-string "|02743107776f726d6e657402657500|" -j REDIRECT --to-ports x, y, z
So Destination port should be 53
Ok...so what's your question??? Have you tried the command you put in here?? What's the problem/issue you're having and trying to solve by doing this??
 
Old 08-03-2022, 11:34 AM   #3
radwan1998
LQ Newbie
 
Registered: Feb 2022
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: 0
redirect the traffic locally to different ports based on the domain name in incoming packets

Quote:
Originally Posted by TB0ne View Post
Ok...so what's your question??? Have you tried the command you put in here?? What's the problem/issue you're having and trying to solve by doing this??
I have installed iodine server on my VPS but the number of connected users at same time is limited #16 , I tried to use different ports for each domain, but as you know dns tunnel works only on port 53 now my question is redirect traffic of multiport to 53, so my purpose is to increase the number of connected users
This is iodine tunnel
https://code.kryo.se/iodine/

Last edited by radwan1998; 08-03-2022 at 11:36 AM.
 
Old 08-03-2022, 11:44 AM   #4
radwan1998
LQ Newbie
 
Registered: Feb 2022
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Ok...so what's your question??? Have you tried the command you put in here?? What's the problem/issue you're having and trying to solve by doing this??
The command I put here is wrong for multiport, but it should look like it
 
Old 08-03-2022, 11:54 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by radwan1998 View Post
I have installed iodine server on my VPS but the number of connected users at same time is limited #16 , I tried to use different ports for each domain, but as you know dns tunnel works only on port 53 now my question is redirect traffic of multiport to 53, so my purpose is to increase the number of connected users
This is iodine tunnel https://code.kryo.se/iodine/
...and...
Quote:
Originally Posted by radwan1998
The command I put here is wrong for multiport, but it should look like it
Did you read the iodine docs?? The part where they *EXPLICITLY SAY* that it can only handle 16 users??? Iodine only supports 16 users, period...and there are iptables commands on the iodine github page. Tried any of those?

If you want more than 16 users, start a second instance listening on another port.
 
Old 08-03-2022, 12:00 PM   #6
radwan1998
LQ Newbie
 
Registered: Feb 2022
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
...and...

Did you read the iodine docs?? The part where they *EXPLICITLY SAY* that it can only handle 16 users??? Iodine only supports 16 users, period...and there are iptables commands on the iodine github page. Tried any of those?

If you want more than 16 users, start a second instance listening on another port.
Yes, for one domain it works fine , but it support only 16 users,
I want more than 16 users, I tried but I don't know how should the iptables look like.

I can Listening on another port, but dns traffic should go through 53 always
That is the problem

Last edited by radwan1998; 08-03-2022 at 12:09 PM.
 
Old 08-03-2022, 12:14 PM   #7
radwan1998
LQ Newbie
 
Registered: Feb 2022
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
...and...

Did you read the iodine docs?? The part where they *EXPLICITLY SAY* that it can only handle 16 users??? Iodine only supports 16 users, period...and there are iptables commands on the iodine github page. Tried any of those?

If you want more than 16 users, start a second instance listening on another port.
(((Make the server listen on 'port' instead of 53 for traffic. If 'listen_ip' does not include localhost, this 'port' can be the same as 'dnsport'. Note: You must make sure the dns requests are forwarded to this port yourself.)))
So the question how to forward requests from multiport to 53
 
Old 08-03-2022, 12:49 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by radwan1998 View Post
Yes, for one domain it works fine , but it support only 16 users, I want more than 16 users, I tried but I don't know how should the iptables look like. I can Listening on another port, but dns traffic should go through 53 always That is the problem
That's not a problem, that's what it's designed to do, isn't it??? Route IPv4 traffic through DNS, which is port 53. And what you WANT is not what iodine DOES...it supports 16 users, period. Want more?? Then rewrite the code to do what you want.
 
  


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
best practice Multihead, multi-screen, multi-display or multi-monitor-Debian 8 lgtrean Linux - Software 1 10-14-2015 09:53 AM
Why am I not able to redirect using htaccess. It says too many redirect rules. swathi.akkineni Linux - Newbie 1 07-31-2015 03:20 PM
Nginx, Horde, Https, Redirect, This webpage has a redirect loop axetone Ubuntu 0 02-08-2015 10:44 PM
[SOLVED] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 04:49 PM
[HELP] redirect traffic to spesific port based on Traffic Content using iptables summersgone Linux - Server 2 06-22-2009 11:26 AM

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

All times are GMT -5. The time now is 01:54 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