I know I can add several IP addresses to an interface without using interface aliases (ex.: eth0:0).
My question: but how can I create different routing decisions for the different IP addresses on one interface? Can someone provide a small example for this?
UPDATE: IP addresses that I got:
$ ip -6 addr show 31: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000 inet6 2001:XXXX::16:3eff:fe76:13c6/64 scope global dynamic valid_lft 85692sec preferred_lft 13692sec inet6 2001:XXXX::XXXX:XXXX/64 scope global valid_lft forever preferred_lft forever inet6 fe80::216:3eff:fe76:13c6/64 scope link valid_lft forever preferred_lft forever
So I got a static IP (2001:XXXX::XXXX:XXXX/64) and a dinamically assigned (2001:XXXX::16:3eff:fe76:13c6/64). The routing:
$ ip -6 route 2001:XXXX::/64 dev eth0 proto kernel metric 256 fe80::/64 dev eth0 proto kernel metric 256 default via fe80::XXXX:XXff:feXX:XXXX dev eth0 proto ra metric 1024 expires 423sec
Outside the host I tried to ping the dinamic IP. I got ping replies. I tried to ping the static IP, I didn't got replies.
ps.: "default via fe80::XXXX:XXff:feXX:XXXX" -> the "fe80::XXXX:XXff:feXX:XXXX" is the IP address of the IPv6 router.