1

I've got a cloud SSD VPS @ OVH, and I'd like to change the default interface used for requests. I have two interfaces: eth0 (which is the default interface) and eth0:0 (which is the new virtual interface that I'd like to use). Here is the output of route -n and the interfaces file:

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

How can I set eth0:0 to default interface? Thanks, Daniil Gentili.

Danogentili
  • 111
  • 1
  • You are using 164.132.40.1 as your default router, there can be only one default route. Hence you need to replace your default gateway with whatever is your router on network 94.23.182.0 also make sure that your netmask is correct on eth0:0, /32 doesn't make a lot of sense there, unless there's a custom setting we don't know about beyond, that host your configuring – kamihack Apr 01 '16 at 18:30

0 Answers0