You are not logged in.

#1 2009-04-28 10:33:52

epic_fail
Member
Registered: 2009-04-28
Posts: 2

How to set static IPv6 address/gateway in Arch (NOT tunnel)

Hey Everybody,

Today I decided to install Arch Linux. There was only one thing that I did not understand, and that is how to set up a static IPv6 address. I have native IPv6 connectivity at home and in Debian I used to edit /etc/network/interfaces to set up a static IPv6 adress. Since Arch uses rc.conf, what is the syntax to configure a static IPv6 address?

I used to add something like this in Debian in /etc/network/interfaces:
> iface eth0 inet6 static
> address *my static address*
> netmask 64
> gateway *my gateway address*

Or can I still use /etc/network/interfaces in Arch?

Thank you for help.

Offline

#2 2009-04-28 10:52:13

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

Wouldn't setting it analogically to the way ipv4 is set up in rc.conf work? The lines there just get fed to ifconfig/route.

eth0="eth0 inet6 blahblah/64"
gateway="default gw blahblah"

Offline

#3 2009-04-28 11:04:19

epic_fail
Member
Registered: 2009-04-28
Posts: 2

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

I will try it now, and post the result here smile!

No, it didn't work. At bootup I see a "unkown host" error, and when running the route command the IPv6 gateway is also not added. I think then the only solution is to add the ifconfig and route commands to rc.local sad. Do you know any other solution?

Last edited by epic_fail (2009-04-28 11:18:44)

Offline

#4 2009-04-28 11:37:25

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

Can't think of any other solution.

Offline

#5 2009-09-01 12:16:03

elipsion
Member
Registered: 2008-06-18
Posts: 1

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

*Bump*

Offline

#6 2009-09-02 04:55:58

gunkaaa
Member
Registered: 2009-09-02
Posts: 1

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

It can be done quite easily using the netcfg infrastructure.

/usr/lib/network/connections/ipv6static

#!/bin/bash
. /usr/lib/network/network


ipv6static_up() {
    load_profile $1
    ip -6 a a ${ADDRESS} dev ${INTERFACE}
    if ! [ -z "${GATEWAY}" ]
    then
        ip -6 r a 2000::/3 via ${GATEWAY} dev ${INTERFACE}
    fi
}

ipv6static_down() {
    load_profile $1
    ip -6 a d ${ADDRESS} dev ${INTERFACE}
    if ! [ -z "${GATEWAY}" ]
    then
        ip -6 r d 2000::/3 via ${GATEWAY} dev ${INTERFACE}
    fi
}

ipv6static_$1 $2
exit $?

/etc/network.d/eth0static

CONNECTION="ipv6static"
DESCRIPTION="Static configuration for IPv6"
ADDRESS="2001:dead:beef:cafe::1/64"
INTERFACE="eth0"
GATEWAY="2001:feed:dead:beef::1" # Comment this out if no route needed

I haven't tested the gateway part, but I don't see why it wouldn't work. You'll need iproute2, and to read up on netcfg (see http://wiki.archlinux.org/index.php/Network_Profiles) if you have trouble.

Last edited by gunkaaa (2009-09-02 05:19:36)

Offline

#7 2011-01-19 10:21:44

baler
Member
Registered: 2009-09-07
Posts: 6

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

note sure if you sorted this but you can use the following syntax in rc.conf

eth0="eth0 192.0.0.1 netmask 255.255.255.0 broadcast 192.0.0.255 add 1:2:3::4/64"

if you want to add multiple addresses just add multiple add statements e.g.

eth0="eth0 192.0.0.1 netmask 255.255.255.0 broadcast 192.0.0.255 add 1:1:1::1/64 add 1:1:1::2/64 add 1:1:1::3/64 add 1:1:1::4/64"

Offline

#8 2011-01-19 21:48:32

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 121

Re: How to set static IPv6 address/gateway in Arch (NOT tunnel)

I'm using the following:

eth0="eth0 172.16.1.8 netmask 255.255.255.0 broadcast 172.16.1.255"
eth0_v6="eth0 inet6 add 2001:6f8:346::8/64"
INTERFACES=(eth0 eth0_v6)

gateway="default gw 172.16.1.1"
gateway6="default gw 2001:6f8:346::1"
ROUTES=(gateway gateway6)

Offline

Board footer

Powered by FluxBB