我正在尝试使用 Ubuntu 14.04 Server 设置网络服务器。
我正在为 /etc/network/interfaces 文件苦苦挣扎。
这是我的设置。
Router IP 192.168.1.254
Externel static IP 212.195.**.*5 (Blanked for security)
Webserver PC IP 192.168.1.67
我也有一些来自我的 ISP 的详细信息
Static IP as above
Mask 255.255.255.255
还有我的路由器中的更多详细信息。
DNS
212.195.70.9
212.195.70.10
我像这样编辑了 /etc/network/interfaces ..
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 212.195.**.*5
netmask 255.255.255.255
network 192.168.1.67
broadcast 192.168.0.255
gateway 192.168.1.254
dns-nameservers 212.195.70.9 212.195.70.10
当我保存这个文件时,我在重启后失去了互联网连接。这告诉我我错了。
谁能帮忙?
谢谢
192.168.x.x
是私有网络地址。看来您的“网络服务器”位于 NAT 路由器的后面,该路由器的内部地址为192.168.1.254
,外部地址为212.195.x.x
.如果您想将此主机暴露在互联网上,请登录路由器管理界面并将 TCP 端口 80 转发到
192.168.1.67
. 您不需要将外部地址添加到/etc/network/interfaces
.network
顺便说一句,联机帮助页中没有这样的指令,当您在网络中时interfaces(5)
使用广播域没有意义。试试这个:192.168.0.x
192.168.1.x
然后让
/etc/resolv.conf
包含: