# Lan Switch

Create a network for the new interface to be attached to, and returns the network-uuid

```
xe network-create name-label="LAN-VM"
```

Find vm uuid of the VM

```
xe vm-list name-label=<vm's name-label>
```

Create eth1 interface for the VM, and gets the uuid of the new interface

```
xe vif-create vm-uuid=<vm-uuid> network-uuid=<network-uuid> device=1 mac=random
```

You can later list the UUID of the new NIC on that vm:

```
xe vif-list vm-uuid=<vm-uuid>
```

Hot-plug the created interface to the VM

```
xe vif-plug uuid=<new_vif_uuid>
```

To disconnect

```
xe vif-unplug uuid=<vif uuid>
xe vif-destroy uuid=<vif uuid>
```

To find Mac on a port:

```
xe vm-vif-list params=dhcp.myhypervisor.ca,MAC
```