---
# System prepended metadata

title: Networking

---

# Networking

Search for dhcp server
```
sudo nmap --script broadcast-dhcp-discover -e <interface>
```
Add macvtap bridge device and bring it up.
```
sudo ip link add link <beneath> <name> address <mac> type macvtap mode bridge
sudo ip link set <name> up
```
Generate mac address.
[Ref](https://jamielinux.com/docs/libvirt-networking-handbook/custom-nat-based-network.html#nat-dummy:~:text=Choose%20a%20MAC%20address%20for%20the%20virtual%20bridge.).
```
# 52:54:00:xx:xx:xx for KVM
hexdump -n3 -e '/3 "52:54:00" 3/1 ":%02x"' /dev/urandom
# 00:16:3e:xx:xx:xx for XEN
hexdump -n3 -e '/3 "00:16:3e" 3/1 ":%02x"' /dev/urandom
# general
hexdump -n6 -e '/1 "%02x" 5/1 ":%02x"' /dev/urandom
```