# Connecting VM to the Internet.

Go to /etc/netplan and make a file called 1-netcfg.yaml

```
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses:
        - address/32
      nameservers:
        addresses:
          - 208.67.222.222
          - 208.67.220.220
      routes:
          - to: 0.0.0.0/0
            via: 144.217.253.254
            on-link: true
      match:
        macaddress: maddress
```

Change the address to the VPS IP

Change the maddress to the Mac Address.&#x20;

then do&#x20;

```
sudo ip link set eth0 down
run the cmd again but with up
sudo ip link set eth0 up

sudo netplan apply 

sudo systemctl restart systemd-networkd

Then test by pinging 8.8.8.8

ping 8.8.8.8

and you should get traffic
```


---

# 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://docs.wavehost.org/connecting-vm-to-the-internet..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.
