我无法连接到同一网络中的其他计算机

时间:2019-06-07 08:42:32

标签: networking localhost apache2

我正在开发一个门户,该门户的主要目的是让我的所有同事(其机器连接到同一网络)访问该门户。

我试图重新安装我的apache服务器,它仍然给我同样的错误。 我正在使用Ubuntu 16.04

我对网络的了解有限,任何帮助都将非常有用。

This is the supposed output when another machine typed the ip address of my machine

我安装了virtualbox,并尝试在虚拟框中打开google chrome和Firefox时测试此问题,我收到以下消息:

Firefox:

Unable to connect

Firefox can’t establish a connection to the server at xxx.xxx.xx.240.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

Chrome:

This site can't be reached
xxx.xxx.xx.240 is unreachable
ERR_ADDRESS_UNREACHABLE

I even tried to acess my portal using a machine that has windows as its os it it gives me this error:

Chrome on windows:

This site can't be reached
xxx.xxx.xx.240 took too long to respond
ERR_CONNECTION_TIMED_OUT

编辑: 根据Tomer Petel的建议,这里是我的vm的ifconfig :(并且由于我们在办公室中的所有计算机都是基于linux的,所以我也在我的vm上使用ubuntu)

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:99:fb:5d  
          inet addr:xxx.xxx.60.xxx  Bcast:192.168.60.255  Mask:255.255.255.0
          inet6 addr: fe80::4463:ae0a:747e:8737/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:98 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12438 (12.4 KB)  TX bytes:7435 (7.4 KB)

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:65536  Metric:1
          RX packets:184 errors:0 dropped:0 overruns:0 frame:0
          TX packets:184 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13471 (13.4 KB)  TX bytes:13471 (13.4 KB)

这是我机器的ifconfig(w / c是门户的服务器)

enp3s0    Link encap:Ethernet  HWaddr 9c:5c:8e:98:c8:51  
          inet addr:xxx.xxx.60.xxx  Bcast:192.168.60.255  Mask:255.255.255.0
          inet6 addr: fe80::4764:697e:9305:12b5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1171474 errors:0 dropped:12 overruns:0 frame:0
          TX packets:735472 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1405120963 (1.4 GB)  TX bytes:82457324 (82.4 MB)

enp4s0    Link encap:Ethernet  HWaddr f4:f2:6d:06:69:72  
          UP BROADCAST 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)

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:65536  Metric:1
          RX packets:1552 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1552 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:4176664 (4.1 MB)  TX bytes:4176664 (4.1 MB)
`I tried netstat -an | grep ':80'
tcp        0      0 192.168.60.250:35724    23.111.228.220:80       ESTABLISHED
tcp        0      0 192.168.60.250:35728    23.111.228.220:80       ESTABLISHED
tcp        0      0 192.168.60.250:35740    23.111.228.220:80       ESTABLISHED
tcp        0      0 192.168.60.250:35732    23.111.228.220:80       ESTABLISHED
tcp        0      0 192.168.60.250:35726    23.111.228.220:80       ESTABLISHED
tcp        0      0 192.168.60.250:35730    23.111.228.220:80       ESTABLISHED
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 192.168.60.250:80       192.168.60.250:34430    TIME_WAIT  `

1 个答案:

答案 0 :(得分:0)

长话短说,这是Web服务器IP配置问题。 您需要通过/etc/network/interfaces而不是ifconfig来配置Web服务器的IP,因为它在重启后不会持续存在。了解如何here