You are not logged in.
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
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
I will try it now, and post the result here !
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 . Do you know any other solution?
Last edited by epic_fail (2009-04-28 11:18:44)
Offline
Can't think of any other solution.
Offline
*Bump*
Offline
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
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
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