The transmission of all packets to the same address and port in ubuntu

0 like 0 dislike
8 views
In the footsteps of the previous question

This:
1.The enterprise network with a Windows proxy for the Internet
2. With Ubuntu server, which communicates with this proxy utility cntlm. This utility listens to 127.0.0.1:6666 (its the same we specify in http_proxy) and then she communicates with the Windows proxy (authenticated etc.).
3.Some things on the server with Ubuntu do not work for example, fopen() in php
Question:
Is it possible to redirect all network packets to 127.0.0.1:6666 and will it help?
For example, using iptables
Email details, with the expectation of LAMERnewbie.
by | 8 views

3 Answers

0 like 0 dislike
in my understanding it should be something like this:
iptables-t nat -A POSTROUTING -i eth* -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:6666
but check is not possible.
by
0 like 0 dislike
though probably more correct so:
iptables-t nat -A OUTPUT-p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:6666
by
0 like 0 dislike
First, the "all ports" to redirect, it won't help. Will help only those with whom they allow to run proxy "on that end". That is, if allowed to CONNECT to 25th port, the SMTP will work, but this port is almost never allowed, etc.
\r
Second rule to redirect http traffic to a transparent proxy:
iptables-t nat -A OUTPUT-p tcp --dport 80 -j REDIRECT --to-ports 6666
if you want, you can stick to a rule, several ports for example 443: -p tcp -m multiport --dports 80,443
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
28,758 users