3 ms·
Why not just? Linux: iptables -t nat -A PREROUTING -p tcp -s 192.168.20.200/0 -d 192.168.0.100/0 --dport 8080 -j REDIRECT --to-ports 20000 Windows: netsh int
by adontz 10y ago
Why not just?
Linux:
iptables -t nat -A PREROUTING -p tcp -s 192.168.20.200/0 -d 192.168.0.100/0 --dport 8080 -j REDIRECT --to-ports 20000
Windows:
netsh interface portproxy add v4tov4 listenaddress=192.168.20.200 listenport=8080 connectaddress=192.168.0.100 connectport=20000 protocol=tcp
- paulddraper 10y agoThose require root/admin access. Still, I agree.
- wmf 10y agoBecause people don't learn the OS.
- AReallyGoodName 10y agoSocat is excellent too. Not as high performance as iptables but the command is very simple to use. More of a direct replacement for the program above.
- eps 10y agoBecause it's not as interesting :)
- user5994461 10y ago-s 192.168.20.200/0 -d 192.168.0.100/0 That sounds wrong. You probably meant /24 or /32. Or you meant to not write anything to not filter it at all.
- adontz 10y agoYeah, sorry for that, was copy-pasting too quickly :-)
- snczl 10y agoOr use the layer-4 load balancer built into the Linux kernel - IPVS (http://kb.linuxvirtualserver.org/wiki/IPVS http://kb.linuxvirtualserver.org/wiki/IPVS). Use Keepalived (http://www.keepalived.org/ http://www.keepalived.org/) for HA and health checking or use Gorb (https://github.com/kobolog/gorb https://github.com/kobolog/gorb) and you can dynamically change services / backends using a REST API.