本地網路連接,無互聯網

本地網路連接,無互聯網

我的伺服器運行的是 Ubuntu 16.04 LTS。我可以在本地網路上連接到它,但無法與內部或外部 ip 進行通訊。我對網路很陌生,所以我不確定到底該怎麼做。

這是resolv.conf

nameserver 75.75.75.75
nameserver 75.75.76.76
search hsd1.mi.comcast.net

這是網路/介面

# The loopback network interface
auto lo
iface lo inet loopback

#Primary Network Interface
auto eno1
iface eno1 inet dhcp

這是 ifconfig:

eno1      Link encap:Ethernet  HWaddr 00:1e:4f:27:0e:c2
          inet addr:10.0.0.144  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: 2601:404:cf00:131:21e:4fff:fe27:ec2/64 Scope:Global
          inet6 addr: fe80::21e:4fff:fe27:ec2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3412971 errors:0 dropped:490 overruns:0 frame:0
          TX packets:2827256 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:484956659 (484.9 MB)  TX bytes:419007083 (419.0 MB)

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:318095 errors:0 dropped:0 overruns:0 frame:0
          TX packets:318095 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:19096128 (19.0 MB)  TX bytes:19096128 (19.0 MB)

這是路線-env

    Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 eno1
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 eno1
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-6535b59b431b

更新!

事實證明,我無法從我的伺服器進行通信,無論是內部還是外部 ip。

答案1

事實證明問題出在我的防火牆上。我跑了ufw status verbose,一切看起來都很好,但我禁用它只是為了檢查,瞧!我可以上網。

我運行ufw reset並重新配置了我的規則,現在一切正常。

答案2

您需要包含伺服器的網路配置和路由表,因為就目前情況而言,我只能看到您的 DNS 設定為75.75.75.7575.75.76.76

從命令提示字元輸入以下命令,並將輸出輸出到上面的原始問題。

ifconfig
route -env

一般情況下,需要設定3件事才能存取外部IP

  1. IP位址。
  2. 路由表(配置了預設網關)。
  3. DNS 伺服器。

相關內容