Configure DNSMode using Network-Config-Manager
nmctl (network-config-manager) is a open source networking tool from vmware to configure and setup the network to the system, It has bunch of options to configure anything like virtual devices, link configuration, network configuration etc. nmctl can be installed in PhotonOS using tdnf command for more details please visit the README.
This article is focused on configuring various DNSMode using nmctl tool.Here are the example's to setup different kind of DNSMode and verify them that is configured correctly or not. Please check the below snippet of executed commands.
# tdnf install -y network-config-manager
Installing:
libedit x86_64 3.1.20221030-2.ph5 photon-updates 243.83k 116.75k
nftables x86_64 1.0.6-1.ph5 photon-updates 954.72k 342.90k
json-c x86_64 0.16-1.ph5 photon-updates 72.99k 38.11k
network-config-manager x86_64 0.6.5-1.ph5 photon-updates 978.60k 242.62k
Total installed size: 2.20M
Total download size: 740.38k
libedit 119552 100%
nftables 351133 100%
json-c 39021 100%
network-config-manager 248446 100%
Testing transaction
Running transaction
Installing/Updating: json-c-0.16-1.ph5.x86_64
Installing/Updating: libedit-3.1.20221030-2.ph5.x86_64
Installing/Updating: nftables-1.0.6-1.ph5.x86_64
Created symlink /etc/systemd/system/multi-user.target.wants/nftables.service → /usr/lib/systemd/system/nftables.service.
Installing/Updating: network-config-manager-0.6.5-1.ph5.x86_64
root@photon-ncm: ~:#nmctl set-dhcp dev test99 dhcp yes
root@photon-ncm: ~:#nmctl add-dns dev test99 dns 192.168.1.45 192.168.1.46
root@photon-ncm: ~:#nmctl sdm dev test99
DNS Mode: merged
root@photon-ncm: ~:#nmctl sdm dev test99 -j
{
"DNSMode": "merged"
}
领英推荐
root@photon-ncm: ~:#nmctl set-dhcp dev test99 dhcp yes
root@photon-ncm: ~:#nmctl sdm dev test99
DNS Mode: DHCP
root@photon-ncm: ~:#nmctl sdm dev test99 -j
{
"DNSMode": "DHCP"
}
root@photon-ncm: ~:#nmctl set-dhcp dev test99 dhcp no
root@photon-ncm: ~:#nmctl add-dns dev test99 dns 192.168.1.45 192.168.1.46
root@photon-ncm: ~:#nmctl sdm dev test99
DNS Mode: static
root@photon-ncm: ~:#nmctl sdm dev test99 -j
{
"DNSMode": "static"
}
root@photon-ncm: ~:#nmctl set-dhcp dev test99 dhcp yes
root@photon-ncm: ~:#nmctl set-dhcp4 dev test99 use-dns no
root@photon-ncm: ~:#nmctl set-dhcp6 dev test99 use-dns no
root@photon-ncm: ~:#nmctl add-dns dev test99 dns 192.168.1.45 192.168.1.46
root@photon-ncm: ~:#nmctl sdm dev test99
DNS Mode: static
root@photon-ncm: ~:#nmctl sdm dev test99 -j
{
"DNSMode": "static"
}
root@photon-ncm: ~:#nmctl set-dhcp dev test99 dhcp yes
root@photon-ncm: ~:#nmctl set-dhcp4 dev test99 use-dns yes
root@photon-ncm: ~:#nmctl set-dhcp6 dev test99 use-dns yes
root@photon-ncm: ~:#nmctl add-dns dev test99 dns 192.168.1.45 192.168.1.46
root@photon-ncm: ~:#nmctl sdm dev test99
DNS Mode: merged
root@photon-ncm: ~:#nmctl sdm dev test99 -j
{
"DNSMode": "merged"
}