我的路由器 IP 是 192.168.1.1。DHCP 范围从 192.168.1.33 到 .64。我的 IP 摄像头 (Hikvision) 设置为 IP 192.168.1.100。有趣的是,只有当 IP 摄像头处于出厂默认设置 (192.0.0.64) 即在另一个子网中并且我设置了虚拟 IP 192.0.0.128 以通过浏览器访问该子网时,我才能访问它。
sudo ifconfig eth0:0 192.0.0.128
我可以通过 Firefox 访问我的 IP 摄像头。但如果我将其 IP 更改为 192.168.1.100,我就无法再访问它,然后 Ubuntu 会在控制台中产生非常不一致的 nmap:
nuc@nuc:~$ nmap 192.168.1.100
Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-14 14:41 CEST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.04 seconds
nuc@nuc:~$ nmap 192.168.1.100
Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-14 14:42 CEST
Nmap scan report for 192.168.1.100
Host is up (0.47s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
21/tcp filtered ftp
23/tcp filtered telnet
80/tcp open http
443/tcp open https
554/tcp open rtsp
7001/tcp open afs3-callback
8000/tcp open http-alt
8200/tcp open trivnet1
49152/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 17.97 seconds
nuc@nuc:~$ nmap 192.168.1.100
Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-14 14:42 CEST
Nmap scan report for 192.168.1.100
Host is up (0.00090s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
21/tcp filtered ftp
23/tcp filtered telnet
Nmap done: 1 IP address (1 host up) scanned in 15.42 seconds
nuc@nuc:~$ nmap 192.168.1.100
Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-14 14:42 CEST
Nmap scan report for 192.168.1.100
Host is up (0.0010s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
21/tcp filtered ftp
23/tcp filtered telnet
7001/tcp open afs3-callback
8000/tcp open http-alt
8200/tcp open trivnet1
Nmap done: 1 IP address (1 host up) scanned in 53.83 seconds
nuc@nuc:~$ nmap 192.168.1.100
Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-14 14:43 CEST
Nmap scan report for 192.168.1.100
Host is up (0.00096s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
21/tcp filtered ftp
23/tcp filtered telnet
Nmap done: 1 IP address (1 host up) scanned in 15.41 seconds
nuc@nuc:~$
Ubuntu 线程虚拟 IP 是否不同?这很可笑,因为如果摄像头位于同一子网中,我无法访问它,出于安全原因,它不应该位于 192.0.0.64 上。但除此之外,它似乎不起作用。这是由 Ubuntu、我的 ipcam 还是我的路由器引起的?
编辑:终端中通常的 ping 192.168.1.100 似乎有效。
以下是一些路由器的截图:
当摄像头位于同一子网中并且我遇到幸运的一秒(参见上面的 nmap)时,我有时会在输入管理员/密码后收到以下屏幕,但大多数时候我会遇到空白浏览器/ Firefox 错误:
编辑2:
事实上,重复 ping 会产生不同的结果。
第一次:
emp@thinkpad:~$ ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 192.168.1.40 icmp_seq=1 Destination Host Unreachable
[...]
From 192.168.1.40 icmp_seq=23 Destination Host Unreachable
64 bytes from 192.168.1.40: icmp_seq=24 ttl=64 time=1136 ms
64 bytes from 192.168.1.40: icmp_seq=25 ttl=64 time=136 ms
[...]
第二次:
emp@thinkpad:~$ ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=6.04 ms
[...]
Ubuntu 为何会这样?
这里还有 2 张图片(我现在已将 IP 摄像头设置为 192.168.1.199,并在左侧终端窗口中对其进行 ping 操作)。
右侧终端窗口在此处显示回溯(sudo tcpdump -i eth0 -v icmp):
这里是 nmap:
答案1
最终发现是因为我的路由器阻塞了某些端口。现在有了供应商给我发来的新路由器,一切都正常了。