IPv6: Difference between revisions
(→Scope) |
No edit summary |
||
Line 7: | Line 7: | ||
!DEC | !DEC | ||
!HEX | !HEX | ||
!Byte | |||
|- | |- | ||
| | | | ||
Line 12: | Line 13: | ||
|0 | |0 | ||
|0 | |0 | ||
| | |||
|- | |- | ||
| | | | ||
Line 17: | Line 19: | ||
|1 | |1 | ||
|1 | |1 | ||
| | |||
|- | |- | ||
| | | | ||
Line 22: | Line 25: | ||
|2 | |2 | ||
|2 | |2 | ||
| | |||
|- | |- | ||
| | | | ||
Line 27: | Line 31: | ||
|3 | |3 | ||
|4 | |4 | ||
| | |||
|- | |- | ||
| | | | ||
Line 32: | Line 37: | ||
|4 | |4 | ||
|4 | |4 | ||
| | |||
|- | |- | ||
| | | | ||
Line 37: | Line 43: | ||
|5 | |5 | ||
|5 | |5 | ||
| | |||
|- | |- | ||
| | | | ||
Line 42: | Line 49: | ||
|6 | |6 | ||
|6 | |6 | ||
| | |||
|- | |- | ||
| | | | ||
Line 47: | Line 55: | ||
|7 | |7 | ||
|7 | |7 | ||
| | |||
|- | |- | ||
| | | | ||
Line 52: | Line 61: | ||
|8 | |8 | ||
|8 | |8 | ||
| | |||
|- | |- | ||
| | | | ||
Line 57: | Line 67: | ||
|9 | |9 | ||
|9 | |9 | ||
| | |||
|- | |- | ||
| | | | ||
Line 62: | Line 73: | ||
|10 | |10 | ||
|A | |A | ||
| | |||
|- | |- | ||
| | | | ||
Line 67: | Line 79: | ||
|11 | |11 | ||
|B | |B | ||
| | |||
|- | |- | ||
| | | | ||
Line 72: | Line 85: | ||
|12 | |12 | ||
|C | |C | ||
| | |||
|- | |- | ||
| | | | ||
Line 77: | Line 91: | ||
|13 | |13 | ||
|D | |D | ||
| | |||
|- | |- | ||
| | | | ||
Line 82: | Line 97: | ||
|14 | |14 | ||
|E | |E | ||
| | |||
|- | |- | ||
| | | | ||
Line 87: | Line 103: | ||
|15 | |15 | ||
|F | |F | ||
|nible | |||
|- | |- | ||
| | | | ||
| | |0001_0000 | ||
|16 | |16 | ||
|10 | |10 | ||
| | |||
|- | |- | ||
| | | | ||
| | |0001_0001 | ||
|17 | |17 | ||
|11 | |11 | ||
| | |||
|- | |- | ||
| | | | ||
Line 102: | Line 121: | ||
|127 | |127 | ||
|7F | |7F | ||
| | |||
|- | |- | ||
| | | | ||
Line 107: | Line 127: | ||
|128 | |128 | ||
|80 | |80 | ||
| | |||
|- | |- | ||
| | | | ||
Line 112: | Line 133: | ||
|255 | |255 | ||
|FF | |FF | ||
|byte | |||
|- | |||
| | |||
|1_0000_0000 | |||
|512 | |||
|100 | |||
| | |||
|- | |||
| | |||
|10_0000_0000 | |||
|1024 | |||
|1000 | |||
|kilo byte | |||
|} | |} | ||
Two characters together is a byte 1000 0000 is 0x80 and 1111 1111 is 0xFF is 255 | Two characters together is a byte 1000 0000 is 0x80 and 1111 1111 is 0xFF is 255 |
Revision as of 09:48, 20 January 2025
Scope
Decimal counting goes to 10. Hexadecimal counts to 16. It uses the numbers 0-10 and then A,B,C,D,E,F. Computers use binary counting with bit 0 or 1 and 4-bit groups can be expressed in hexadecimal.
BIN | DEC | HEX | Byte | |
---|---|---|---|---|
0000 | 0 | 0 | ||
0001 | 1 | 1 | ||
0010 | 2 | 2 | ||
0011 | 3 | 4 | ||
0100 | 4 | 4 | ||
0101 | 5 | 5 | ||
0110 | 6 | 6 | ||
0111 | 7 | 7 | ||
1000 | 8 | 8 | ||
1001 | 9 | 9 | ||
1010 | 10 | A | ||
1011 | 11 | B | ||
1100 | 12 | C | ||
1101 | 13 | D | ||
1110 | 14 | E | ||
1111 | 15 | F | nible | |
0001_0000 | 16 | 10 | ||
0001_0001 | 17 | 11 | ||
0111_1111 | 127 | 7F | ||
1000_0000 | 128 | 80 | ||
1111_1111 | 255 | FF | byte | |
1_0000_0000 | 512 | 100 | ||
10_0000_0000 | 1024 | 1000 | kilo byte |
Two characters together is a byte 1000 0000 is 0x80 and 1111 1111 is 0xFF is 255
IPv6 Addresses are 128 bits long, written down in 8 times 2 bytes long separated by a colon, 2 colons to shorten a long row of zero's
- 1 means loopback address, so "own interface"
FE80::/10 is used for local communication.
FF01::/16 is used for Multicast addresses, where the network gets to decide which service is closest.
2001::/16 is used for Global Unicast Addresses.
The mask /16 defines how many bits are used for the network part. The rest is the host part, routing works on the network part
Each interface has one or more addresses. The link will have a default fe80 address which is not routable outside the link scope
fe80::7c0e:e6ff:fe7b:40f0/64 fe80 is link-local address ff:fe (plus the first 'bit') makes eui-48 mac an eui-64 rfc8064 replace the address with a hash
The gateway gets an IP address from the provider. Global address starts with 2001, the provider is abcd, the subnet is efg0, the
2001:db8:efg0:1234::1/128 /16 2001 is for unicast addresses /48 0db8 is for the providers, db8 specifically is for documentation /56 efg0 is for the subnet-id /64 bits for end users to subdivide
clients
Google Android does not support DHCPv6. It must use SLAAC for assigning IPv6 addresses. SLAAC must use /64 prefixes with EUI-64 host addresses.
OPNSense - WAN IPv6 DHCP Client: Request Prefix-only - LAN IPv6 track WAN, Prefix-ID 0x0
IPv6 Prefix ID
Manual configuration V
DHCPv6 Configured
- a000 - ::f000
/usr/local/sbin/radvd -p /var/run/radvd.pid -C /var/etc/radvd.conf -m syslog
/var/etc/rarvd.conf
foreach ($stanzas as $stanza) { $radvdconf .= "#\tprefix {$stanza} {\n"; $stanza = strtok($stanza, '/'); $stanza = $stanza."/64"; $radvdconf .= "\tprefix {$stanza} {\n";
Stanza should have included Prefix-ID to make it /64
https://github.com/opnsense/docs/blob/master/source/manual/ipv6.rst
https://github.com/opnsense/docs/blob/master/source/manual/radvd.rst
src/etc/inc/plugins.inc.d/dhcpd.inc
list (, $networkv6) = interfaces_primary_address6($dhcpv6if, $ifconfig_details); if (is_subnetv6($networkv6)) {
$stanzas[] = $networkv6;
} $stanzas[] = "{$subnetv6}/{$vip['subnet_bits']}";
https://github.com/opnsense/core/blob/master/src/etc/inc/plugins.inc.d/dhcpd.inc#L353
Add If statement to replace prefix to /64
IPv6
assign IP address
Setup routes
DNS servers
DHCPv6
SLAAC
M Managed Flag, advertise dhcpv6 exists
O Other Flag, use DHCP to assign other parameters
A Autonomous, use SLAAC Prefix to use EUI-64 and Privacy address
Prefix must be /64