通过 RT-N66U 路由器访问 Web 服务器

通过 RT-N66U 路由器访问 Web 服务器

在此先非常感谢您的大力支持。

我的本地家庭网络中有一个 Ubuntu LAMP 服务器,根据我目前的观察和调试,我认为我的 ASUS RT-N66U 路由器中有一些严重的设置,导致 Web 服务器无法通过路由器运行。

经过一周的调试,我决定尝试更换非常非常旧的 D-Link WBR-1310 路由器,问题神奇地消失了,因此我相当有信心(但不是完全有信心)问题出在我的华硕路由器的某些设置上。或者,我的服务器上有一些不太可能的设置,以某种方式将其绑定到我的旧路由器(MAC?)的特性上……这似乎不太可能,但也许是可能的(我以前确实在同一网络上使用过这款路由器)。

问题不是黑白分明的“访问受阻”类型的错误,而是访问速度极慢,通常最终会超时,有时需要几分钟才能加载页面。在我的 D-Link 路由器上加载一个简单的页面需要大约 5 毫秒,如果我幸运的话,在华硕上需要大约 2-5 分钟,而大多数情况下它会在几分钟后超时。它有时可以加载一半菜单、一半图像,但更多的时候是旋转并无进展。

设置

- LAMP server on a static IP, 192.168.0.101
- Ubuntu 11 (Natty Narwhal)
- A Win7 PC, dynamic IP 192.168.0.200
- ASUS RT-N66U Router, LAN IP 192.168.0.1
- Router has a good WAN IP, internet working fine.
- Router is setup to grant dynamic IPs for a range of 192.168.0.104+
- When swapping in an old D-Link router (problem disappears), with same LAN IP (192.168.0.1)
- Using the raw IP address (192.168.0.101) to access the server
- server and client both wired connections
- IPv6 is disabled 
- VPN & traffic manager disabled
- no cron jobs running on the server.
- No static routes are setup on the router (not daisy chained to anything)

观察结果

- Takes minutes (or times out) for a simple page to load across the ASUS router
- Takes milliseconds to load the same page across the DLink router 
- Pinging works fine across the local network to/from the server
- Pinging works for to both the Router LAN IP and its WAN IP
- SSH also appears to be extremely slow (or times out)
- Evidence of some intermittent condition: 
  The server IP appears and disappears in the routers connected client IP list.  
  However, pinging constantly works and the physical connection is never really dropping.  
- Traceroute confirms its just going 1 quick hop on the LAN to the server.
- [Edit] HTTP Internet access from server to outside through router has the same extremely slow/intermittent issue

到目前为止的调试

- Disabled port forwarding for access from LAN.
- Enabled port 80 forwarding for access from WAN. 
   This replicates the same extremely slow access situation that the LAN is experiencing.
- Did a factory reset on the ASUS router to start clean.
- Upgraded to latest ASUS router firmware. 
- Disabled DNS (but im using the raw IP anyways) on router
- Disabled reverse DNS lookups on server
- Telnet'ed into router to check iptables settings. No packets hitting any deny rule. 
- Disabled firewall on router
- Disabled mysql, SSH services on server
- Problem isn't a specific webpage on the server, happens with any (such as phpmyadmin).
- Checked router system log, server apache2 error logs (log level=debug) 
- Tried changing the server to use a dynamic IP as an experiment 
- Tried grepping to see if the MAC address of my old router appears on my server

还调整了服务器本身的许多设置(主机、httpd.conf、apache2.conf、网络接口、nsswitch.conf、一次关闭并重新启动多个服务),直到发现简单的路由器交换完全解决了问题(服务器上没有任何变化,路由器中的 IP 设置相同),所以现在我正试图将范围缩小到路由器配置问题。

对下一步有什么想法吗?感谢您的专业知识 :) Simon

相关内容