How to use nmcli in linux In Linux

The nmcli command is a command-line tool for managing network connections in Linux. To set up a network bridge using the nmcli command, follow these steps:

Step 1: Open your terminal and run the following command:

nmcli connection add type bridge ifname br0 

In the above command br0 is the name that we choose to give to the bridge connection , you can type in any name you like.

Step 2: Run the following command to add the physical network interface to the bridge:

nmcli connection add type bridge-slave ifname eth0 master br0 con-name br0-enp0s3

Now look carefully we have used our physical interface name that is eth0 in my case. You have to type your physical interface name which you can see by typing IP link in terminal and further more we have br0-enp0s3 this is just our connection name we choose to give, you can give any name you like.

Step 3: Run the following command to start the bridge:

nmcli connection up br0

After this our bridge is ready and in use by our system. You can verify it by opening network manager in linux. You can see in the below image we have our bridge connection listed in networks and bridges.

How to Set up a Network Bridge for Virtual Machine in Linux

We all have used virtual machines now or then, and they come in very handy when someone wants to run multiple instances of different operating systems in one go, or their main operating system. When you work with virtual machines it’s important to connect them to a local network or to be able to access the internet through VM. So in this article, we will see two methods by which you will be able to set up a network bridge in your virtual machine. To do so follow the step-by-step guide below.

Similar Reads

Method 1: Using VirtualBox GUI manager

Step 1: Open the VirtualBox manager...

Method 2: Using nmcli in linux

The nmcli command is a command-line tool for managing network connections in Linux. To set up a network bridge using the nmcli command, follow these steps:...

Conclusion

With the help of this article you will be able to set up a network bridge in VirtualBox, enabling your virtual machine to connect to your local network or the internet with ease. You can always explore more and try on new configurations with systems. You can enhance the networking capabilities of your VMs and make them an integral part of your network infrastructure....