我在 OVH 有一个云 SSD VPS,我想更改用于请求的默认接口。我有两个接口:eth0(默认接口)和 eth0:0(我想使用的新虚拟接口)。以下是 route -n 和接口文件的输出:
daniil@vps262458:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 164.132.40.1 0.0.0.0 UG 0 0 0 eth0
164.132.40.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
daniil@vps262458:~$ cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 164.132.40.39
netmask 255.255.255.255
post-up /sbin/ip route add 164.132.40.1 dev eth0
post-up /sbin/ip route add default via 164.132.40.1
pre-down /sbin/ip route del default via 164.132.40.1
pre-down /sbin/ip route del 164.132.40.1 dev eth0
dns-nameserver 213.186.33.99
dns-search ovh.net
auto eth0:0
iface eth0:0 inet static
address 94.23.182.116
netmask 255.255.255.255
如何将 eth0:0 设置为默认接口?谢谢,Daniil Gentili。