Forum

linux: redirect por...
 
Notifications
Clear all

linux: redirect port with response

2 Posty
1 Users
0 Likes
1,400 Widok
0
Topic starter

redirect to another squid server on diffrent ip

2 Answers
0
Topic starter

172.16.1.124 – external squid server
172.16.1.210 – server where you need to type this command
3139 – internal squid port
3218 – external squid port

1
2
3
4
5
6
7
8
9
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
iptables -t nat -A PREROUTING -p tcp --dport 3139 -j DNAT --to-destination 172.16.1.124:3128
iptables -t nat -A POSTROUTING -p tcp -d 172.16.1.124 --dport 3128 -j SNAT --to-source 172.16.1.210
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
iptables -t nat -A PREROUTING -p tcp --dport 3139 -j DNAT --to-destination 172.16.1.124:3128
iptables -t nat -A POSTROUTING -p tcp -d 172.16.1.124 --dport 3128 -j SNAT --to-source 172.16.1.210
0
Topic starter
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -F
iptables -t nat -F
iptables -X

iptables -t nat -A PREROUTING -p tcp --dport 3128 -j DNAT --to-destination 172.16.1.124:3128
iptables -t nat -A POSTROUTING -p tcp -d 172.16.1.124 --dport 3128 -j SNAT --to-source 172.16.1.210

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: