在Ubuntu Server上设置多个IP地址的问题

我想在我的系统上设置两个IP地址,以便通过LAN进行访问。 这是我在其他系统上的配置。

桌面安装

我的连接信息

我的桌面安装运行时通过LAN和wifi通过网络管理器添加了多个IP。

服务器安装

在我的服务器上安装我已经编辑/etc/network/interfaces到以下内容:

 auto eth0 auto eth0:1 # IP-1 iface eth0 inet static address 172.16.35.35 network 172.16.34.1 netmask 255.255.254.0 broadcast 172.16.35.255 dns-nameservers 172.16.100.221 8.8.8.8 # IP-2 iface eth0:1 inet static address 172.16.34.34 network 172.16.34.1 netmask 255.255.254.0 gateway 172.16.34.1 broadcast 172.16.35.255 

通过/etc/init.d/networking restart我收到了

未能提出eth0:1

我究竟做错了什么?

我发布这个问题已经很久了。 虽然我从未使用多个地址配置旧服务器,但以下是我目前在不同服务器上使用的工作配置。

 auto eth0 iface eth0 inet static address 172.16.100.125 netmask 255.255.255.0 network 172.16.100.0 broadcast 172.16.100.255 gateway 172.16.100.1 dns-nameservers 172.16.100.221 208.67.222.222 auto eth0:0 iface eth0:0 inet static name Ethernet alias LAN card address 172.16.100.123 netmask 255.255.255.0 network 172.16.100.0 broadcast 172.16.100.255 gateway 172.16.100.1 

我知道这有点晚了但我的猜测是你可以做到以下几点:

编辑/etc/network/interfaces

 auto venet 0:0 iface venet 0:0 inet static address XXX.XX.XXX.XXX netmask 255.XXX.XXX.XXX auto venet 0:1 iface venet 0:1 inet static address XXX.XX.XXX.XX1 netmask 255.XXX.XXX.XXX auto venet 0:2 iface venet 0:2 inet static address XXX.XX.XXX.XX2 netmask 255.XXX.XXX.XXX