Ubuntu Server-没有互联网连接


0

我已经在具有两个网卡的服务器计算机上安装了Ubuntu Server,而其中只有一个连接到本地网络。当我键入:

sudo nano /etc/network/interfaces

我得到以下信息:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p2p1
iface p2p1 inet static
    address 161.53.68.226
    netmask 255.255.255.0
    network 161.53.68.0
    broadcast 161.53.68.255
    gateway 161.53.68.1

当我尝试:

ping 8.8.8.8

我收到“无法到达目标主机”。我该如何解决?

PS也许这也可以帮助。当我打字

route -n

我得到:

Kernel IP routing table
Destination    Gateway    Genmask    Flags Metric Ref    Use Iface

即路由表为空。

谢谢!

最好,马可。

Answers:


0

你可以试试:

须藤ifdown p2p1;须藤ifup p2p1

或手动添加网关(重启后将不会保留此网关):

sudo ip r通过161.53.68.1 dev p2p1添加默认值

无论如何,您可以从接口中删除网络和广播,这些将自动解决。只需输入地址,网络掩码和网关。


我按照您的建议进行了操作,但在ping 8.8.8.8时仍然收到“无法到达目标主机”的消息
— Marko Gulin

可以发布ip address请的输出吗?
— Pr0sper0
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.