永久增加路线

永久增加路线

我正在尝试永久添加路由到我的 VPS,目前每次发现服务器重新启动时,我都必须手动运行该命令。我读到过某处说我必须向 /etc/network/interfaces 添加一些内容,但它与我的设置不匹配 - 我有多个接口,并且该方法似乎与我在文件中看到的不匹配。

我以 root 身份运行的命令是:

ip route add 10.33.252.0/24 via 10.33.252.75

我的 /etc/network/interfaces 文件如下所示:

# This configuration file is auto-generated.
#
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and
# /etc/network/interfaces.tail instead, their contents will be
# inserted at the beginning and at the end of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.
#

# Auto generated lo interface
auto lo
iface lo inet loopback

# Auto generated venet0 interface
auto venet0
iface venet0 inet manual
        up ifconfig venet0 up
        up ifconfig venet0 127.0.0.2
        up route add default dev venet0
        down route del default dev venet0
        down ifconfig venet0 down


iface venet0 inet6 manual
        up route -A inet6 add default dev venet0
        down route -A inet6 del default dev venet0

auto venet0:0
iface venet0:0 inet static
        address 198.91.90.242
        netmask 255.255.255.255

auto venet0:1
iface venet0:1 inet static
        address 69.175.32.40
        netmask 255.255.255.255

auto venet0:2
iface venet0:2 inet static
        address 69.175.32.41
        netmask 255.255.255.255

auto venet0:3
iface venet0:3 inet static
        address 69.175.32.42
        netmask 255.255.255.255

auto venet0:4
iface venet0:4 inet static
        address 69.175.32.43
        netmask 255.255.255.255

auto venet0:5
iface venet0:5 inet static
        address 69.175.32.138
        netmask 255.255.255.255

auto venet0:6
iface venet0:6 inet static
        address 173.236.6.220
        netmask 255.255.255.255

auto venet0:7
iface venet0:7 inet static
        address 198.91.90.243
        netmask 255.255.255.255

auto venet0:8
iface venet0:8 inet static
        address 10.33.252.75
        netmask 255.255.255.255

任何帮助都将非常感谢:)

相关内容