# Lab Docs, Tutorials/Guides and Notes This is where most documentation about my lab and experiences will be stored. for archival and as a free knowledge base to anyone who might stumble upon it # Setting up a tailscale/headscale exit-node ### On the client The example below is for linux client 1. install tailscale using your method of choice, I picked the one liner script ```bash # one liner script from tailscale curl -fsSL https://tailscale.com/install.sh | sh # If for some reason you can't use the one liner script to install it, refer to the official docs for manually installing at https://tailscale.com/download/linux/debian-bookworm ``` 2. run this command to initiate the tailscale client with a custom control server ```bash # Sample tailscale up --login-server "http://your-headscale-serverip:port" --advertise-exit-node # Since I run headscale on the same machine I want to use as an exit-node, I set it as localhost tailscale up --login-server "http://localhost:8082" --advertise-exit-node # If the node is already registered, then we can advertise it as an exit-node in this manner tailscale set --advertise-exit-node ``` ### On the server 1. First we confirm that our nodes are seen and their routes are either `0.0.0.0/0` and/or `::/0` ```bash # Check routes using this command headscale routes list # Output ID | Machine | Prefix | Advertised | Enabled | Primary 1 | exit-node1 | 0.0.0.0/0 | true | false | - 2 | exit-node1 | ::/0 | true | false | - 3 | phone1 | ::/0 | false | false | - 4 | phone1 | 0.0.0.0/0 | false | false | - 5 | phone2 | ::/0 | false | false | - 6 | phone2 | 0.0.0.0/0 | false | false | - ``` As we can confirm here, the routes are advertised, but not enabled. 2. To enable the routes, we will use the following command to allow the exit-node to advertise itself, you will have to repeat this for every exit-node you want to add. ```bash # First select the route you wanna add, in my case I want both IPv4 and IPv6 so I'll add id 1 and 2 ID | Machine | Prefix | Advertised | Enabled | Primary 1 | exit-node1 | 0.0.0.0/0 | true | false | - 2 | exit-node1 | ::/0 | true | false | - 3 | phone1 | ::/0 | false | false | - 4 | phone1 | 0.0.0.0/0 | false | false | - 5 | phone2 | ::/0 | false | false | - 6 | phone2 | 0.0.0.0/0 | false | false | - # Command headscale routes enable -r 1 headscale routes enable -r 2 # Confirm we enabled it headscale routes list ID | Machine | Prefix | Advertised | Enabled | Primary 1 | exit-node1 | 0.0.0.0/0 | true | true | - 2 | exit-node1 | ::/0 | true | true | - 3 | phone1 | ::/0 | false | false | - 4 | phone1 | 0.0.0.0/0 | false | false | - 5 | phone2 | ::/0 | false | false | - 6 | phone2 | 0.0.0.0/0 | false | false | - ``` 3. Test with your client to see if it worked, with these steps done any client should be able to utilize your new exit-node # IP Index (WIP)
This Document Outlines plenty of publicly recognized IPv4 and IPv6 Addresses
Address Block | Address range | Number of Addresses | Scope | Description |
0.0.0.0/8 | 0.0.0.0-0.255.255.255 | 16,777,216 | Software | Current |
10.0.0.0/8 | 10.0.0.0–10.255.255.255 | 16,777,216 | Private network | Used for local communications within a private network. |
100.64.0.0/10 | 100.64.0.0–100.127.255.255 | 4,194,304 | Private network | Shared address space for communications between a service provider and its subscribers when using a carrier-grade NAT. |
127.0.0.0/8 | 127.0.0.0–127.255.255.255 | 16,777,216 | Host | Used for loopback addresses to the local host. |
169.254.0.0/16 | 169.254.0.0–169.254.255.255 | 65,536 | Subnet | Used for link-local addresses between two hosts on a single link when no IP address is otherwise specified, such as would have normally been retrieved from a DHCP server. |
172.16.0.0/12 | 172.16.0.0–172.31.255.255 | 1,048,576 | Private network | Used for local communications within a private network. |
192.0.0.0/24 | 192.0.0.0–192.0.0.255 | 256 | Private network | IETF Protocol Assignments, DS-Lite (/29). |
192.0.2.0/24 | 192.0.2.0–192.0.2.255 | 256 | Documentation | Assigned as TEST-NET-1, documentation and examples. |
192.88.99.0/24 | 192.88.99.0–192.88.99.255 | 256 | Internet | Reserved. Formerly used for IPv6 to IPv4 relay (included IPv6 address block 2002::/16). |
192.168.0.0/16 | 192.168.0.0–192.168.255.255 | 65536 | Private network | Used for local communications within a private network. |
198.18.0.0/15 | 198.18.0.0–198.19.255.255 | 131,072 | Private network | Used for benchmark testing of inter-network communications between two separate subnets. |
198.51.100.0/24 | 198.51.100.0–198.51.100.255 | 256 | Documentation | Assigned as TEST-NET-2, documentation and examples. |
203.0.113.0/24 | 203.0.113.0–203.0.113.255 | 256 | Documentation | Assigned as TEST-NET-3, documentation and examples. |
224.0.0.0/4 | 224.0.0.0–239.255.255.255 | 268,435,456 | Internet | In use for IP multicast. (Former Class D network.) |
233.252.0.0/24 | 233.252.0.0-233.252.0.255 | 256 | Documentation | Assigned as MCAST-TEST-NET, documentation and examples. |
240.0.0.0/4 | 240.0.0.0–255.255.255.254 | 268,435,455 | Internet | Reserved for future use. (Former Class E network.) |
255.255.255.255/32 | 255.255.255.255 | 1 | Subnet | Reserved for the "limited broadcast" destination address. |
Address Block | First address | Last Address | Number of addresses | Scope | Description |
::/128 | :: | :: | 1 | Software | Unspecified address |
::1/128 | ::1 | ::1 | 1 | host | Loopback address—a virtual interface that loops all traffic back to itself, the local host |
::ffff:0:0/96 | ::ffff:0.0.0.0 | ::ffff:255.255.255.255 | 232 | Software | IPv4-mapped addresses |
::ffff:0:0:0/96 | ::ffff:0:0.0.0.0 | ::ffff:0:255.255.255.255 | 232 | Software | IPv4 translated addresses |
64:ff9b::/96 | 64:ff9b::0:0:0:0 | 64:ff9b::255.255.255.255 | 232 | Global Internet | IPv4/IPv6 translation |
64:ff9b:1::/48 | 64:ff9b:1:: | 64:ff9b:1:ffff:ffff:ffff:ffff:ffff | 2,80 with 248 for each IPv4 | Private internets | IPv4/IPv6 translation |
100::/64 | 100:: | 100::ffff:ffff:ffff:ffff | 264 | Routing | Discard prefix |
2001:0000::/32 | 2001:: | 2001::ffff:ffff:ffff:ffff:ffff:ffff | 296 | Global Internet | Teredo tunneling |
2001:20::/28 | 2001:20:: | 2001:2f:ffff:ffff:ffff:ffff:ffff:ffff | 2100 | Software | [ORCHIDv2](https://en.wikipedia.org/w/index.php?title=ORCHIDv2&action=edit&redlink=1 "ORCHIDv2 (page does not exist)") |
2001:db8::/32 | 2001:db8:: | 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff | 296 | Documentation | Addresses used in documentation and example source code |
2002::/16 | 2002:: | 2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff | 2112 | Global Internet | The [6to4](https://en.wikipedia.org/wiki/6to4 "6to4") addressing scheme (deprecated) |
fc00::/7 | fc00:: | fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | 2121 | Private Internets | [Unique local address](https://en.wikipedia.org/wiki/Unique_local_address) |
fe80::/64 from fe80::/10 | fe80:: | fe80::ffff:ffff:ffff:ffff | 264 | Link | [Link-local address](https://en.wikipedia.org/wiki/Link-local_address#IPv6) |
ff00::/8 | ff00:: | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | 2120 | Global Internet | [Multicast address](https://en.wikipedia.org/wiki/Multicast_address#IPv6 "Multicast address") |