Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3260

System and Network configuration • [Solved] IPTables redirect rule works on amazon linux, not on debian

$
0
0
Hi folks,
Here is my iptables:

Code:

Chain PREROUTING (policy ACCEPT)target     prot opt source               destination         REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:submission redir ports 23001REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:31284 redir ports 23002REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2223 redir ports 23003REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:35742 redir ports 23004REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:imaps redir ports 23005REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:https redir ports 23006REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2224 redir ports 23007REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2225 redir ports 23008REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:imap2 redir ports 23009REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:smtp redir ports 23010REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:submissions redir ports 23011REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:http redir ports 23012REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2222 redir ports 23013Chain INPUT (policy ACCEPT)target     prot opt source               destination         Chain OUTPUT (policy ACCEPT)target     prot opt source               destination         REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:submission redir ports 23001REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:31284 redir ports 23002REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2223 redir ports 23003REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:35742 redir ports 23004REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:imaps redir ports 23005REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:https redir ports 23006REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2224 redir ports 23007REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2225 redir ports 23008REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:imap2 redir ports 23009REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:smtp redir ports 23010REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:submissions redir ports 23011REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:http redir ports 23012REDIRECT   tcp  --  anywhere             anywhere             tcp dpt:2222 redir ports 23013Chain POSTROUTING (policy ACCEPT)target     prot opt source               destination         
My server is accessible locally on ports 80 and 23012. But not from outside. Any ideas?

Code:

$ curl 127.0.0.1:80<html><head><title>401 Authorization Required</title></head><body><center><h1>401 Authorization Required</h1></center><hr><center>nginx/1.24.0</center></body></html>$ curl 127.0.0.1:23012<html><head><title>401 Authorization Required</title></head><body><center><h1>401 Authorization Required</h1></center><hr><center>nginx/1.24.0</center></body></html>
Same set of rules works on another instance with amazon linux. Any idea is highly appreciated. Thanks in advance.

Statistics: Posted by aario — 2024-01-30 12:16 — Replies 5 — Views 168



Viewing all articles
Browse latest Browse all 3260

Trending Articles