我在 IP 为 192.168.1.101 的 PC 上运行 Ubuntu 10.04。一切正常,例如我的 Web 服务器正在运行,我可以正常看到http://localhost/或http://192.168.1.101。
但问题是我无法在 192.168.1.102 的笔记本电脑上看到我的电脑,例如在我的笔记本电脑http://192.168.1.101上,浏览器中的连接超时。或尝试在任何端口上远程登录会导致:
telnet: Unable to connect to remote host: Connection timed out
笔记本电脑也在运行全新安装的 Ubuntu,并且两台计算机中都没有设置防火墙内容。
PS:
两台电脑可以
ping
互相很好。路由器是一个 cicso linksys 无线 ADSL 调制解调器。
目前,我可以毫无问题地从 192.168.1.101 连接到在 192.168.1.102 上运行的 Windows 上的 FTP 服务器。
我用朋友的笔记本电脑(他们使用 Windows 7 和 XP)测试了地址http://192.168.1.101 。都收到“连接已重置”。它与我的笔记本电脑的响应不同。
这些是在我的 PC 192.168.1.101 上运行的命令:
ifconfig
:
adp@adp-desktop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:26:18:e1:8e:cf
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe70::226:18ff:fee1:8ecf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1831935 errors:0 dropped:0 overruns:0 frame:0
TX packets:1493786 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1996855925 (1.9 GB) TX bytes:215288238 (215.2 MB)
Interrupt:27 Base address:0xa000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:951742 errors:0 dropped:0 overruns:0 frame:0
TX packets:951742 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:494351095 (494.3 MB) TX bytes:494351095 (494.3 MB)
vmnet1 Link encap:Ethernet HWaddr 00:50:46:c0:00:01
inet addr:192.168.91.1 Bcast:192.168.91.255 Mask:255.255.255.0
inet6 addr: fe70::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:46:c0:00:08
inet addr:192.168.156.1 Bcast:192.168.156.255 Mask:255.255.255.0
inet6 addr: fe70::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
端口 80 设置为 0.0.0.0 好:
adp@adp-desktop:~$ netstat -ln | grep 'LISTEN '
tcp 0 0 127.0.0.1:52815 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4559 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:7634 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5280 0.0.0.0:* LISTEN
tcp 0 0 127.0.1.1:7777 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:33601 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp6 0 0 :::139 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 :::445 :::* LISTEN
/etc/hosts.deny
是空的:
adp@adp-desktop:~$ cat /etc/hosts.deny
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
# See the manual pages hosts_access(5) and hosts_options(5).
#
# Example: ALL: some.host.name, .some.domain
# ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID
netstat -l
:
adp@adp-desktop:~$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:52815 *:* LISTEN
tcp 0 0 *:hylafax *:* LISTEN
tcp 0 0 *:www *:* LISTEN
tcp 0 0 *:4369 *:* LISTEN
tcp 0 0 localhost:7634 *:* LISTEN
tcp 0 0 *:ftp *:* LISTEN
tcp 0 0 *:xmpp-server *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 *:5280 *:* LISTEN
tcp 0 0 adp-desktop:7777 *:* LISTEN
tcp 0 0 *:33601 *:* LISTEN
tcp 0 0 *:xmpp-client *:* LISTEN
tcp 0 0 localhost:mysql *:* LISTEN
tcp6 0 0 [::]:netbios-ssn [::]:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
tcp6 0 0 [::]:microsoft-ds [::]:* LISTEN
udp 0 0 *:bootpc *:*
udp 0 0 *:mdns *:*
udp 0 0 *:47467 *:*
udp 0 0 192.168.1.10:netbios-ns *:*
udp 0 0 192.168.91.1:netbios-ns *:*
udp 0 0 192.168.156.:netbios-ns *:*
udp 0 0 *:netbios-ns *:*
udp 0 0 192.168.1.1:netbios-dgm *:*
udp 0 0 192.168.91.:netbios-dgm *:*
udp 0 0 192.168.156:netbios-dgm *:*
udp 0 0 *:netbios-dgm *:*
raw 0 0 *:icmp *:* 7
netstat -rn
:
adp@adp-desktop:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.91.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
192.168.156.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
笔记本电脑上的命令,192.168.1.102:
如果配置:
root@fakeuser-laptop:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1c:33:a2:31:15
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:21
eth1 Link encap:Ethernet HWaddr 00:2d:d9:3e:1f:6c
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe70::21d:d9ff:fe3e:1f6c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5681 errors:0 dropped:0 overruns:0 frame:10313
TX packets:6717 errors:6 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4055251 (4.0 MB) TX bytes:779308 (779.3 KB)
Interrupt:18
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:206 errors:0 dropped:0 overruns:0 frame:0
TX packets:206 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15172 (15.1 KB) TX bytes:15172 (15.1 KB)
netstat -rn
:
root@fakeuser-laptop:~# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
telnet
:
fakeuser@fakeuser-laptop:~$ telnet 192.168.1.101 25
Trying 192.168.1.101...
telnet: Unable to connect to remote host: Connection timed out
fakeuser@fakeuser-laptop:~$ telnet 192.168.1.101 22
Trying 192.168.1.101...
telnet: Unable to connect to remote host: Connection timed out
fakeuser@fakeuser-laptop:~$ telnet 192.168.1.101 80
Trying 192.168.1.101...
telnet: Unable to connect to remote host: Connection timed out
您在问题中提供的其他信息表明您的笔记本电脑的以太网连接存在问题。在您的 ifconfig 输出中报告了超过一万个帧错误。
当您的卡配置为自动/自动时,这有时是由交换机端口设置为 100/全双工引起的。要确认在您的笔记本电脑上执行此操作: