Skip to content

Commit 795582b

Browse files
authored
Update README for latest WSL
Latest WSL release has distro install functionality we rely on. Hence I have updated the README. - Removed reference to manual installation of WSL 2.4.4. - Add instructions on adding routes to Windows. - Added SSH Tunnel instructions for SecureCRT. - Added note to DevPod instructions for using inbuilt SSH.
1 parent 4e4cb81 commit 795582b

File tree

1 file changed

+66
-8
lines changed

1 file changed

+66
-8
lines changed

README.md

+66-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
A WSL distribution designed for easy 'plug and play' usage with [Containerlab](https://containerlab.dev).
44

5-
> [!IMPORTANT]
6-
> WSL 2.4.4 is required to use this distribution. It is currently in
7-
> pre-release, meaning you must manually install it.
8-
>
9-
> [Download](https://github.com/microsoft/WSL/releases/tag/2.4.4)
10-
11-
125
| OS | Supported | VM-based NOSes |
136
| :--------: | :---------: | :------------: |
147
| Windows 10 | Yes | No |
@@ -20,7 +13,7 @@ We recommend using Windows Terminal for the best experience:
2013

2114
# Quick Start
2215

23-
**Ensure WSL2.4.4 or newer is installed.**
16+
**Ensure you are on the latest version of WSL (WSL2.4.4 or newer). Use `wsl --update`.**
2417

2518
- Download the `.wsl` file from the [releases page](https://github.com/kaelemc/wsl-clab/releases/latest).
2619
- Double click the `.wsl` file to install.
@@ -236,6 +229,71 @@ see with the DevPod button, or configure the lab workspaces yourself.
236229
237230
![DevPod settings screenshot](./images/devpod_settings.png)
238231
232+
> [!NOTE]
233+
> You may have to tick 'Use Builtin Ssh' for correct behaviour.
234+
235+
# Accessing lab nodes
236+
237+
You probably want to access your nodes from a terminal application your computer, such as SecureCRT, MobaXTerm, PuTTY etc.
238+
239+
There are two ways you can achieve this:
240+
- On Windows, add a static route to the lab management network.
241+
- SSH Tunneling/Proxy (depends on terminal/console application support).
242+
243+
## Adding a static route
244+
245+
You can add a static route to Windows, where the destination subnet is your labs management subnet, and the next hop is the IP of Containerlab WSL.
246+
247+
### Step 1 - Get the IP Address of Containerlab WSL
248+
249+
In Containerlab WSL -- Execute and copy/note down the outputted IP address
250+
```bash
251+
ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
252+
```
253+
254+
### Step 2 - Add the route
255+
256+
By default the Containerlab management subnet is `172.20.20.0/24`. If you have used a custom management subnet in your toplogy, please adjust the below command accordingly.
257+
258+
In Windows, open an elevated Command Prompt Window (Run as Administrator). Execute the following (replace `<Management Subnet>`, `<Management Mask>` and `<WSL IP Address>`)
259+
```cmd
260+
route add <Management Subnet> MASK <Management Mask> <WSL IP ADDRESS>
261+
```
262+
263+
For example, if using the default management subnet of `172.20.20.0/24`, and the Containerlab WSL IP address was `172.28.121.79`; The command would be:
264+
```cmd
265+
route add 172.20.20.0 MASK 255.255.255.0 172.12.121.79
266+
```
267+
268+
### Removing the route (Optional)
269+
270+
If for some reason you need to remove the route, say the subnet or WSL IP address changed, you can execute the following in an elevated Command Prompt window:
271+
```cmd
272+
route delete <Management Subnet>
273+
```
274+
275+
## Configuring SSH tunneling (SecureCRT)
276+
277+
In SecureCRT you can configure SSH tunneling so you can access your lab nodes (running in WSL) without having to modify routes in Windows.
278+
279+
### Step 1 - Configure an SSH session to WSL Containerlab
280+
281+
In SecureCRT create and save an SSH session to WSL Containerlab. Session parameters are below:
282+
283+
**Session Parameters**
284+
285+
- Hostname: `wsl.localhost`
286+
- Port: `2222`
287+
- Username: `clab`
288+
289+
Ensure you save the session.
290+
291+
### Step 2 - Add sessions to your lab nodes
292+
293+
The only remaining step is when adding lab nodes, ensure you go to the 'Firewall' settings -> 'Select Session' -> Select the saved session to WSL (default name: `wsl.localhost`).
294+
295+
Now you should be able to 'natively' connect to your lab nodes from within Windows.
296+
239297
# Developers
240298

241299
Development should be performed from another WSL distribution.

0 commit comments

Comments
 (0)