Debian: More ipv6 addresses then ipv4

Hi

do you know how I can add 3 static ipv6 addresses under Debian while I only have 2 ipv4 addresses?

auto lo

iface lo inet loopback

auto eth0 eth0:0 eth0:1

iface eth0 inet dhcp

iface eth0 inet static

address 109.74.192.6

netmask 255.255.255.0

broadcast 109.74.192.255

gateway 109.74.192.1

iface eth0:0 inet static

address 178.79.180.239

netmask 255.255.255.0

iface eth0 inet6 static

address 2a01:7e00:0000:0000:f03c:91ff:fe96:59f7

netmask 64

gateway fe80:0000:0000:0000:0000:0000:0000:0001

iface eth0:0 inet6 static

address 2a01:7e00:0000:0000:0000:0000:0017:5000

netmask 64

gateway fe80:0000:0000:0000:0000:0000:0000:0001

iface eth0:1 inet6 static

address 2a01:7e00:0000:0000:0000:0000:0017:5001

netmask 64

ip -6 addr show

1: lo: mtu 16436

inet6 ::1/128 scope host

validlft forever preferredlft forever

2: eth0: mtu 1500 qlen 1000

inet6 2a01:7e00::17:5000/64 scope global

validlft forever preferredlft forever

inet6 2a01:7e00::f03c:91ff:fe96:59f7/64 scope global

validlft forever preferredlft forever

inet6 fe80::f03c:91ff:fe96:59f7/64 scope link

validlft forever preferredlft forever

Thanks!

Laurensup>up>

4 Replies

Personally, my /etc/network/interfaces mostly uses 'up ip' and 'down ip' to manage IPs:

auto eth0
iface eth0 inet static
    address 67.18.187.111
    gateway 67.18.187.1
    netmask 255.255.255.0
    up ip addr add 192.168.130.4/17 dev eth0
    down ip addr del 192.168.130.4/17 dev eth0
    up ip addr add 2600:3c00::2:b001/64 dev eth0
    down ip addr del 2600:3c00::2:b001/64 dev eth0
    up ip addr add 2600:3c00::2:b401/64 dev eth0 preferred_lft 0
    down ip addr del 2600:3c00::2:b401/64 dev eth0

(I let the autoconfigured address, well, autoconfigure, and don't explicitly list it in /etc/network/interfaces.)

Thank you :).

I got them running that way..

I should have added, the "preferred_lft 0" part is a hack to stop it from being used as the source IP for outgoing connections. If you don't care about that, you can remove it.

@mnordhoff:

Personally, my /etc/network/interfaces mostly uses 'up ip' and 'down ip' to manage IPs:

(I let the autoconfigured address, well, autoconfigure, and don't explicitly list it in /etc/network/interfaces.)

Many thanks for sharing that - sorted me out just fine!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct