我想阻止我的Windows机器的直接访问,并希望通过我的Linux机器(它也可以通过公共IP访问)公开一些在其上运行的程序。
有没有一种方法可以configuration我的Linux机器(比如说IP = abcd)
,将在特定端口(比如6667
)获得的所有UDP
stream量路由到端口6668
Windows机器上(比如IP = efgh
)?
是的,我该如何执行它?
UPDATE
# bindadress bindport connectaddress connectport 192.168.2.45 6667 192.168.2.104 6668 # logging information logfile /var/log/rinetd.log # uncomment the following line if you want web-server style logfile format logcommon ~
UPDATE
我只想路由UDP
stream量。
安装rinetd。 在这个程序中,您可以轻松configuration传入端口和传出端口。 首先安装程序。 然后更改/etc/rinetd.conf
例如:
#bindadress bindport connectaddress connectport
abcd 6667 efgh 6668
http://brokestream.com/udp_redirect.html
这是从实际解决问题的聊天讨论
iptables -t nat -A PREROUTING -i $EXT_IF -p udp -d $EXT_IP --dport 53 -j DNAT --to-destination $INTERNAL_SERVER and make sure you also have it allowed to pass through the FORWARD chain with something like #forward traffic iptables -A FORWARD -i $EXT_IF -o $INT_IF -p udp -d $INTERNAL_SERVER --dport 53 -j ACCEPT #reply traffic iptables -A INPUT -o $EXT_IF -i $INT_IF -p udp -s $INTERNAL_SERVER --sport 53 -m state --state ESTABLISHED,RELATED -j ACCEPT
是的,这被称为反向NAT,是Linux的IpTablesfunction的一部分。 每个体面的NATtins防火墙都会这样做,以暴露服务。