This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
irc:openbsd:ipv6 [2019/11/09 10:38] jrmu created |
irc:openbsd:ipv6 [2020/07/14 13:07] (current) jrmu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Replace if0 with your own device name. Inside /etc/hostname.if0, put: | + | If you chose DHCP when first installing the OS, you may want to edit the networking configuration manually (to switch to a static IP). |
+ | |||
+ | Openbsd requires one hostname.if per device, where the letters 'if' are replaced with an abbreviation followed by a device number. So, for example, an Atheros IEEE 802.11a/b/g/n wifi device is abbreviated by athn0, and will need an /etc/hostname.athn0 file. | ||
+ | |||
+ | Replace if with your own device name. Inside /etc/hostname.if0, put: | ||
<code> | <code> | ||
- | inet 192.169.1.2 255.255.255.0 | + | inet 192.168.1.2 255.255.255.0 |
- | inet alias 192.169.1.3 255.255.255.0 | + | inet alias 192.168.1.3 255.255.255.0 |
inet6 2001:0db8:0000:0000:0000:0000:0000:0000 48 | inet6 2001:0db8:0000:0000:0000:0000:0000:0000 48 | ||
inet6 alias 2001:0db8:0000:0000:9b1d:3511:387e:143a 48 | inet6 alias 2001:0db8:0000:0000:9b1d:3511:387e:143a 48 | ||
Line 37: | Line 41: | ||
inet6 alias 2001:0db8:0000:0000:46ad:1add:cb77:154b 48 | inet6 alias 2001:0db8:0000:0000:46ad:1add:cb77:154b 48 | ||
inet6 alias 2001:0db8:0000:0000:b664:368a:d94b:3ce8 48 | inet6 alias 2001:0db8:0000:0000:b664:368a:d94b:3ce8 48 | ||
+ | </code> | ||
+ | |||
+ | Let's look at the first two lines: | ||
+ | |||
+ | <code> | ||
+ | inet 192.168.1.2 255.255.255.0 | ||
+ | inet alias 192.168.1.3 255.255.255.0 | ||
+ | </code> | ||
+ | |||
+ | The first line will set the device to use the static IP 192.168.1.2 with subnet mask 255.255.255.0. The second line will allow the device to use a second static IP, 192.168.1.3. It will be aliased to the first and have the same subnet mask. | ||
+ | |||
+ | Let's look at lines 3 and 4: | ||
+ | |||
+ | <code> | ||
+ | inet6 2001:0db8:0000:0000:0000:0000:0000:0000 48 | ||
+ | inet6 alias 2001:0db8:0000:0000:9b1d:3511:387e:143a 48 | ||
+ | </code> | ||
+ | |||
+ | The first one sets the device to use the static IPv6 address 2001:0db8:: with a /48 subnet, and the second one creates another IPv6 address 2001:0db8:0000:0000:9b1d:3511:387e:143a with a /48 subnet, aliased to the first IPv6 address. In this way, you can create dozens of unique IPv6 addresses so that each user on a shell account or bouncer can get a unique IPv6 address. | ||
+ | |||
+ | You will also need to specify the default gateway in /etc/mygate: | ||
+ | |||
+ | <code> | ||
+ | 192.168.1.1 | ||
+ | 2001:0db8:0000:0000::1 | ||
</code> | </code> | ||
Line 46: | Line 75: | ||
But this doesn't seem to properly reset the networking sometimes. | But this doesn't seem to properly reset the networking sometimes. | ||
+ | |||
+ | Watch out! Iked, without the -6 flag, will block all IPv6 traffic. | ||
+ | |||
+ | If you later decide you want to add a new ipv6 address, use ifconfig: | ||
+ | |||
+ | <code> | ||
+ | $ doas ifconfig if0 inet6 2001:0db8::/64 | ||
+ | </code> | ||
+ | |||
+ | To delete the IPv6 address: | ||
+ | |||
+ | <code> | ||
+ | $ doas ifconfig if0 inet6 2001:0db8::/64 delete | ||
+ | </code> | ||
+ | |||
+ | Replace if0 with your specific interface. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | To test if an IPv6 address is working, you can use netcat to connect to an IRC network that supports IPv6: | ||
+ | |||
+ | <code> | ||
+ | $ nc -s 2001:0db8:: ipv6.ircnow.org 6667 | ||
+ | nick newnick | ||
+ | user newuser * * :newuser | ||
+ | PING :12345 | ||
+ | PONG :12345 | ||
+ | </code> | ||
+ | |||
+ | If that loads a message, then you configured the IPv6 address 2001:0db8:: correctly. |