# Routing between virtual interfaces

## comper2004

My ISP is migrating me to a new IP block. I have two sets of disjoint addresses:

```
    10.0.0.xxx gw 10.0.0.1 (netmask 255.255.255.0)

    10.10.0.xxx gw 10.10.0.1 (netmask 255.255.255.0)
```

They are providing a migration path that means that we can keep working without downtime, but it does mean we have to configure our machines to deal with two gateways. With two interfaces (eth0 and eth1), I can use the following iproute2 setup with addresses 10.0.0.44 and 10.10.0.55 respectively:

```
    ip route add 10.0.0.1/32 dev eth0 src 10.0.0.44 table oldgw

    ip route add default via 10.0.0.1 table oldgw

    ip rule add from 10.0.0.44 table oldgw

    ip route add 10.10.0.1/32 dev eth1 src 10.10.0.55 table newgw

    ip route add default via 10.10.0.1 table newgw

    ip rule add from 10.10.0.55 table newgw
```

I have another machine with only one interface. The above trick does not appear to work with virtual interfaces (eth0:xx). Is there a workaround ?

----------

## nativemad

Hi, 

Have a look here... https://forums.gentoo.org/viewtopic-t-834203.html  :Wink: 

HTH, Cheers

----------

## comper2004

Duh! Why didn't I spot that post before! Sorry for posting something samey and thanks for your help  :Smile: 

----------

## nativemad

Don't worry... the forum-search could really be better and as long as i remember my own posts here and do not have to explain something twice because of it, it's not an issue!   :Laughing: 

----------

