# 2.0 Creating a Tailscale Connection

---

##### <span style="color: rgb(0, 0, 0);">**Adding a Device**</span>

1. <span style="color: rgb(0, 0, 0);">Go to your<span style="color: rgb(22, 145, 121);"> [Tailscale Admin Console](https://login.tailscale.com/admin/machines)</span></span>
2. <span style="color: rgb(0, 0, 0);">Add new machine on user’s Tailscale</span>
    
    
    - <span style="color: rgb(0, 0, 0);">Add device &gt; Linux Server</span>  
          
        <span style="color: rgb(0, 0, 0);">![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcUAhYuPJ2l5aNV2n5f-kCU9_1QRJzlZAmxqty5KUWUJHucwONpbZuFG2ovZ8Yw-dH-QjOwNq3J1YGsFuHtv07Skf-63lYttIEjo77fvajRFEsWX9FK4F133xe5ut5B_GTg6l3MmQ?key=A7w7-IIrPHtvIEAignbkTKHY)</span>
3. <span style="color: rgb(0, 0, 0);">Generate install script</span>  
    <span style="color: rgb(0, 0, 0);">![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTlpWmjTMZgaLV5pjkw_HiHbefVr40VlRqfkAL01hzvMEZbyppVGteMzpIQwPGJ6v7Tkj79hICzr7w8bKwUsBEBq0_ep-fdt0KqgU6gGmfkM0L0esAG-jauDwa1vd751tYX31U_w?key=A7w7-IIrPHtvIEAignbkTKHY)</span>
4. <span style="color: rgb(0, 0, 0);">Copy and paste install script into user's Ubuntu Server VM *(might have to manually type it out if ssh isn't configured // all one continuous line)*</span>  
    <p class="callout info"><span style="color: rgb(35, 111, 161);">**EXAMPLE:**</span>  
    <span style="color: rgb(35, 111, 161);">curl -fsSL https://tailscale.com/install.sh | sh &amp;&amp; sudo tailscale up --auth-key=tskey-auth-kEc5KrwcPv11CNTRL-rsE7QpaFhNeKRnTdUALKJgbkJ2Vg</span>  
    </p>
5. <span style="color: rgb(0, 0, 0);">Start up Tailscale in it:</span>  
    ```
    sudo tailscale up
    ```
6. <span style="color: rgb(0, 0, 0);">Open the given login link and sign into Tailscale</span>

---

##### <span style="color: rgb(0, 0, 0);">**Configure Advertised Subnet Routes**</span>

1. <span style="color: rgb(0, 0, 0);">To connect to <span style="color: rgb(22, 145, 121);">[Tailscale as a subnet router](https://tailscale.com/kb/1019/subnets)</span>, type in the following commands:</span><p class="callout info"><span style="color: rgb(52, 73, 94);">**<span style="color: rgb(35, 111, 161);">Note - Change the advertise routes according to your subnet in a home lab environment</span>  
    <span style="color: rgb(45, 194, 107);">**<span style="color: rgb(35, 111, 161);">\*Any confusion on command syntax/structure can be clarified in </span><span style="color: rgb(45, 194, 107);">[Legend](https://wiki.raspberrypiclub.org/books/how-to-refer-to-the-documentation/page/legend)</span>**</span>** </span></p>
    
    ```
    echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
    echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p /etc/sysctl.conf
    ```
2. <span style="color: rgb(0, 0, 0);">To advertise subnet routes, type into the shell:  
    </span><p class="callout info"><span style="color: rgb(35, 111, 161);">**CIDR Notation uses a slash (/) and a number to indicate the length of the network prefix *(e.g. 10.0.0.0/24)***</span></p>
    
    ```
    sudo tailscale up --advertise-routes=[IP ADDRESS CIDR]
    ```
3. <span style="color: rgb(0, 0, 0);">Enable the configured route on Tailscale</span>
    - <span style="color: rgb(0, 0, 0);">Edit route settings &gt; Check the box with the IP route &gt; Save</span>

<span style="color: rgb(0, 0, 0);">**IMAGE SHOWING WHERE TO EDIT ROUTE SETTINGS:**</span>

<span style="color: rgb(0, 0, 0);">![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXelMndY6N88PZZX-TBD2Fu5xjo-PCZJzwspFKs3wgoQ-gnZuYEVSPYYAch6c2TD5Nbn9I3J5rHnaK7oJ_yntC-rvd5cIxDNluZ-0345NsaltPIE1jlGB5OIofLYXZeULop2f_LRMQ?key=A7w7-IIrPHtvIEAignbkTKHY)</span>

<span style="color: rgb(0, 0, 0);">*Last Updated: 2/22/2025  
Contributors: Lilian, Vivian* </span>