From Fedora Project Wiki
Line 45: Line 45:


<pre>
<pre>
ip address add 192.168.1.1/24 dev eth0
# ip address add 192.168.1.1/24 dev eth0
ip address add 2001:db8:1:2::1 dev eth0
# ip address add 2001:db8:1:2::1 dev eth0
</pre>
</pre>

Revision as of 20:27, 10 December 2012

Using automatic link-local addresses (IPv6-only)

Link-local addresses on Ethernet work without any configuration tools except that you have to activate the interface first.

# device=eth1
#
# ip link set $device up

Kernel automatically assigns a MAC-derived link-local address to any active Ethernet interface.

# ip address show dev $device

If you know another link-local address on the network, you should be able to test it with the ping command.

# ping .....

Oh, wait, ping doesn't work. Use ping6.

# ping6 .....

Failed again. Now we're getting to the point. Link-local addresses use the same network prefix on every interface. We need to specify the local network interface to be used to contact the particular link-local address.

# ping6 ....%eth0

Static runtime configuration (iproute2)

# ip address add 192.168.1.1/24 dev eth0
# ip address add 2001:db8:1:2::1 dev eth0