So, here is my system: I have a 2Wire AT&T modem/router which I use for wireless and a Buffalo router flashed with DD-WRT which is physically attached to the 2Wire and set in the DMZ. I set everything up on the DD-WRT to be able to connect to it using ssh and also so that it forwards ssh requests on a different port to one of the servers behind it. Now, when I am physically connected to the DD-WRT all this works great and as I would want it to. I ssh into the two different ports using the WAN IP of my network, and I get where I expect to land. If, however, I am connected using wi-fi to the 2Wire, the same commands do not work. I do not get an error, simply a timeout. I have trouble understanding this, since the DD-WRT is set in the DMZ and everything should pass to it. To further complicate the problem, I tried connecting to the same IP using my phone (wireless disabled, so really from the WAN) and surprise, it works! If I go back on the local network by enabling the wifi, the ssh connection times out. To make this even stranger, my WAN IP address always responds to pings (meaning in all the above situations). What could be going on here?
I know what I should do, completely disable the 2wire as a router and use it strictly as a modem and them use all the routing capabilities of the dd-wrt. It's what I will probably end up doing anyway, but my question remains, because I really want to know what is happening here.
[Edit] The above is pretty vague, so I'll try and provide a few more clues. The 2wire got an address from the ISP that looked something like 99.xx.xx.38. It used the same address to denote the one device placed in the DMZ, in this case the dd-wrt. For all other clients it used DHCP to automatically give an address in the 192.168.1.100-254 range. To be clear: the address of the dd-wrt on the local network was identical to the wan address of the 2wire modem/router. The dd-wrt was only connected to one computer through a cable and it gave it a static IP of 192.168.1.100.
What I forgot to mention is that I used to have an almost identical setup where I used a Belkin router instead of the DD-WRT. I switched because the Belkin didn't allow me to send magic packets to the broadcast address. Anyway, with the Belkin instead of the DD-WRT, the above issue was non-existent. The configuration was as close to identical as I could make it. I could connect to the 99.xx.xx.38 address from anywhere, from either inside or outside the local network, and no time-outs would occur.