1

I have a script that tries to connect to rabbitmq using default url and port (localhost:5672).

Is it possible to make linux redirect all connections to this url and port to different server?

I am creating some proof of concept and such thing would be useful for me.

1

2 Answers 2

4

I found a better solution for you:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport port -j DNAT --to-destination ip:port
1

As you are asking for a script, so I think you are asking for a userspace tool.

nc -l -p 8888 -c "nc example.com 8888"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .