# Routing

## Set/Unset interface

### ip

From here <https://www.redeszone.net/tutoriales/servidores/configurar-linux-comando-ip-iproute2-suite/>

To see links, masks, local network config:

```bash
ip a
ip link show
```

To activate an interface:

```bash
ip link set enp0s1 up
```

To deactivate an interface:

```bash
ip link set enp0s1 down
```

To configure a network interface:

```bash
ip addr add 192.168.1.1/24 dev enp0s1
```

To delete a network interface:

```bash
ip addr del 192.168.1.1 dev enp0s1
```

### nmcli

If we detect a interface as "disconnected".

```bash
nmcli device status
```

We could try to "activate" it:

```bash
nmcli dev connect enp0s8
```

And maybe the interface now is giving us new info (:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lanzt.gitbook.io/cheatsheet-pentest/pivoting/routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
