单个接口上分配多个 IP,Ubuntu 14.04

单个接口上分配多个 IP,Ubuntu 14.04

我有一系列的公共对象,我需要使用别名将它们全部分配到单个物理接口上,但是在添加它们之后,重新启动接口时似乎出现了问题。这是配置

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 51.x.x.x
        netmask 255.255.255.255
        network 51.x.x.x
        broadcast 51.x.x.x
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        post-up route add 46.x.x.x dev eth0
        post-up route add default gw 46.x.x.x
        post-down route del 46.105.116.254 dev eth0
        post-down route del default gw 46.x.x.x


auto eth0:1
iface eth0:1 inet static
        address 51.x.x.x
        netmask 255.255.255.255
        network 51.x.x.x
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        post-up route add 46.x.x.x dev eth0:1
        post-up route add default gw 46.x.x.x
        post-down route del 46.105.116.254 dev eth0:1
        post-down route del default gw 46.x.x.x

相关内容