I have a weird problem. I can run this command just fine from various servers:
wget --debug '--http-user=USER123' '--http-passwd=PASSWORD' http://GW-BOX:9091/weijhkdsvn/v9_odbc//CRONTAB.2014020
Where "GW-BOX" is the gateway to my network, USER123 and PASSWORD represent the user and password for weijhkdsvn, and 9091 points to an internal Linux server. The problem is that that this command times out and/or gets rejected.
wget --debug '--http-user=USER123' '--http-passwd=PASSWORD' http://GW-BOX:9093/weijhkdsvn/v9_odbc//CRONTAB.20140206
Port 9093 points to a different internal server. Note that the only difference is the port.
So then I tried to do a wget directly from the server, to ensure that http was configured correctly:
wget --debug '--http-user=USER123' '--http-passwd=PASSWORD' http://9091-Server:80/weijhkdsvn/v9_odbc//CRONTAB.20140206
In this case, 9091-Server is the internal server that port 9091 refers to. It works fine. Then I tried the same command, but mimicing port 9093:
wget --debug '--http-user=USER123' '--http-passwd=PASSWORD' http://9093-Server:80/weijhkdsvn/v9_odbc//CRONTAB.20140206
where 9093-Server refers to the internal server that 9093 points to.
So the above examples prove that 9093-Server has http setup correctly to allow wget, as far as I can see. This suggests that maybe the problem is with GW-BOX, so I tested the ports with telnet, and port 9091 worked fine.
[wmsodbc]> telnet GW-BOX 9091
Trying GW-BOX...
Connected to GW-BOX.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
[wmsodbc]>
But port 9093 did not work:
[wmsodbc]> telnet GW-BOX 9093
Trying GW-BOX...
telnet: connect to address GW-BOX: Connection refused
[wmsodbc]>
So then I checked iptables on GW-BOX:
[root@wmsgateway ~]# iptables-save | grep "909[13]"
-A INPUT -p tcp -m tcp --dport 9091 -j LOG
-A INPUT -p tcp -m tcp --dport 9093 -j LOG
-A PREROUTING -d GW-BOX-EXTERNAL-IP/32 -p tcp -m tcp --dport 9091 -j DNAT --to-destination 9091-ServerIp:80
-A PREROUTING -d GW-BOX-EXTERNAL-IP/32 -p tcp -m tcp --dport 9093 -j DNAT --to-destination 9093-ServerIp:80
-A POSTROUTING -d 9091-ServerIp/32 -p tcp -m tcp --dport 9091 -j SNAT --to-source GW-BOX-INTERNAL-IP
-A POSTROUTING -d 9093-ServerIp/32 -p tcp -m tcp --dport 9093 -j SNAT --to-source GW-BOX-INTERNAL-IP
[root@wmsgateway ~]#
So what else can I check to see why port 9091 accepts wget/telnet requests, but 9093 does not?