Tuesday, September 29, 2020

The Network Bridge on Device VMnet0 is not Running

When we are going start our VM, then one error message is appeared says, "The Network bridge on device vmnet0 is not running". One screenshot is given below about this error.


During install vmware workstation, some virtual network adapter is installed with it. To work with physical network adapter, these virtual network adapters is used some protocols, that also be installed during vmware workstation installing. Those protocols are responsible for transfer traffic to physical network from the virtual machine. If for any reason those protocols can't be run, then this virtual machine can't communicate with host or physical network. This is the things, that those error message want to explain.

To troubleshoot this issue, we have to check whether these protocols is running. There are some antivirus program, which apply restrictions on these protocols to work on properly. That's why, the protocol can't be run and as a result, the bridging functions between the host and virtual machine are interrupted. If we are going to disable our antivirus program to troubleshoot this issue, there will be no luck. Because, the antivirus program block this protocol from network adapter level. The antivirus apply some filters on network adapter, that is giving restriction to the vmware bridge protocol. In this tutorial, we are going to talk about "Kaspersky Antivirus" program, which is responsible to originate this issue.

If you are experiencing this problem, then most probably the "Kaspersky Internet Security" is installed on your computer. If yes, then  go to you network adapter driver from "Network & Sharing Center". Right click on your network adapter and go to "Properties". Here you will find one item from list named "Kaspersky Anti-Virus NDIS 6 Filter". One screenshot is given below:-


Just clear the tick mark from this item. Also make sure that, "VMware Bridge Protocol" is installed and tick mark is given for this entry. Just like below:-


Finally click "OK" and restart your vmware workstation program. Hope, this time no error message will be displayed.

Sunday, September 27, 2020

Vmware New USB Device Detected Popup

In "Vmware" version 15, sometimes we are getting popup message related with USB device. The complete message is "New USB Device Detected". One screenshot of the popup message is below:-

This popup message is appearing continuously even we select the option "Remember my choice". In this tutorial we will learn about, how to stop this popup from being displayed. Let's start...

First of all go to "Edit" from menu bar and then select "Preferences".


Now click on "USB" from list and make a choice from the right panel.

Remember one thing, you can't select "Ask me what to do" option. If so, then this popup will be displayed aging and again.


Saturday, September 26, 2020

IP Address Configuration Linux

In Linux operating system, we can configure IP address in two ways. One is using graphical mode and the other is using command line mode. Again, during the operating system installation time an IP address can be configured. However, in order to configure the IP address graphically, the graphical environment must be pre-installed. In this tutorial, we will learn how to configure IP using command line mode.

We know that, when a network interface card is inserted into the Linux operating system, a script file is generated. By editing that script file, we can configure the IP address for that network interface card. The location of the file is: -


One thing we need to keep in mind here is that, the name for the first network card will be “ifcfg-eth0”, then the name for the second will be “ifcfg-eth1”, the name for the third will be “ifcfg-eth2”, and so on.

Now we will open the script of that network card using “VI editor”. If you want, you can use any editor other than "VI Editor". The complete command to open the file is: -


Since, after opening the file it will be in “read only” mode, so we will have to go to “insert” mode. To go into “insert” mode we need to press “i” from the keyboard. 

After opening the file, we will add some lines here. The lines are: -

IPADDR=192.168.3.150
NETMASK=255.255.255.0
GATEWAY=192.168.3.253

One thing to note here is that, by default Linux operating system enables "dhcp" mode for IP address configuration. 


So we have to add the above lines as well as disable the "dhcp" mode. To disable "dhcp" we need to set “BOOTPROTO = static” or "none”.


So the changes we need to make to the file are: -

BOOTPROTO=static
IPADDR=192.168.3.61
NETMASK=255.255.255.0
GATEWAY=192.168.3.253

Here is a screenshot:


After changing the value, we will exit the "insert" mode by pressing the "escape" button. At the end of all, we will save and close the file using the following command.


After configuring our IP address, we have to configure our DNS address. The file we need to edit to configure the DNS address is: -


After opening the file, we will add the following line.

nameserver  10.10.10.5 (ip address of our dns server)

If we want, we can add more lines and configure many dns servers. E.g.

nameserver  10.10.10.5 (ip address of our dns server)
nameserver  172.16.5.239 (ip address of our dns server)

Here is a screenshot:


If we have already added a "nameserver", we can edit the existing lines if we want without creating new lines. After saving the file, we need to restart the network service once. That is why the command is:-


This time we can check our IP address using the following command.

All our work is done.


Ubuntu Configure IP Address

In Ubuntu operating system, we can configure IP address in two ways. One is using graphical mode and the other is using command line mode. Again, during the operating system installation time an IP address can be configured. However, in order to configure the IP address graphically, the graphical environment must be pre-installed. In this tutorial, we will learn how to configure IP using command line mode.

We know that, when a network interface card is inserted into the Ubuntu operating system, a script file is generated. By editing that script file, we can configure the IP address for that network interface card. The location of the file is: -


One thing we need to keep in mind here is that, the name for the first network card will be “ifcfg-eth0”, then the name for the second will be “ifcfg-eth1”, the name for the third will be “ifcfg-eth2”, and so on.

Now we will open the script of that network card using “VI editor”. If you want, you can use any editor other than "VI Editor". The complete command to open the file is: -


Since, after opening the file it will be in “read only” mode, so we will have to go to “insert” mode. To go into “insert” mode we need to press “i” from the keyboard. 

After opening the file, we will add some lines here. The lines are: -

IPADDR=192.168.3.61
NETMASK=255.255.255.0
GATEWAY=192.168.3.253

One thing to note here is that, by default Ubuntu operating system enables "dhcp" mode for IP address configuration. 


So we have to add the above lines as well as disable the "dhcp" mode. To disable "dhcp" we need to set “BOOTPROTO = static” or "none”.


So the changes we need to make to the file are: -

BOOTPROTO=static
IPADDR=192.168.3.61
NETMASK=255.255.255.0
GATEWAY=192.168.3.253

Here is a screenshot:


After changing the value, we will exit the "insert" mode by pressing the "escape" button. At the end of all, we will save and close the file using the following command.


After configuring our IP address, we have to configure our DNS address. The file we need to edit to configure the DNS address is: -


After opening the file, we will add the following line.

nameserver  10.10.10.5 (ip address of our dns server)

If we want, we can add more lines and configure many dns servers. E.g.

nameserver  10.10.10.5 (ip address of our dns server)
nameserver  172.16.5.239 (ip address of our dns server)

Here is a screenshot:


If we have already added a "nameserver", we can edit the existing lines if we want without creating new lines. After saving the file, we need to restart the network service once. That is why the command is:-


This time we can check our IP address using the following command.


All our work is done.

CentOS Configure IP Address

In CentOS operating system, we can configure IP address in two ways. One is using graphical mode and the other is using command line mode. Again, during the operating system installation time an IP address can be configured. However, in order to configure the IP address graphically, the graphical environment must be pre-installed. In this tutorial, we will learn how to configure IP using command line mode.

We know that, when a network interface card is inserted into the CentOS operating system, a script file is generated. By editing that script file, we can configure the IP address for that network interface card. The location of the file is: -

One thing we need to keep in mind here is that, the name for the first network card will be “ifcfg-eth0”, then the name for the second will be “ifcfg-eth1”, the name for the third will be “ifcfg-eth2”, and so on.

Now we will open the script of that network card using “VI editor”. If you want, you can use any editor other than "VI Editor". The complete command to open the file is: -

Since, after opening the file it will be in “read only” mode, so we will have to go to “insert” mode. To go into “insert” mode we need to press “i” from the keyboard. 

After opening the file, we will add some lines here. The lines are: -

IPADDR=192.168.3.61

NETMASK=255.255.255.0

GATEWAY=192.168.3.253

One thing to note here is that, by default CentOS operating system enables "dhcp" mode for IP address configuration. 


So we have to add the above lines as well as disable the "dhcp" mode. To disable "dhcp" we need to set “BOOTPROTO = static” or "none”.


So the changes we need to make to the file are: -

BOOTPROTO=static
IPADDR=192.168.3.61
NETMASK=255.255.255.0
GATEWAY=192.168.3.253

Here is a screenshot:


After changing the value, we will exit the "insert" mode by pressing the "escape" button. At the end of all, we will save and close the file using the following command.


 After configuring our IP address, we have to configure our DNS address. The file we need to edit to configure the DNS address is: 


After opening the file, we will add the following line.

nameserver  10.10.10.5 (ip address of our dns server)

If we want, we can add more lines and configure many dns servers. E.g.

nameserver  10.10.10.5 (ip address of our dns server)
nameserver  172.16.5.239 (ip address of our dns server)

Here is a screenshot:


If we have already added a "nameserver", we can edit the existing lines if we want without creating new lines. After saving the file, we need to restart the network service once. That is why the command is:-


This time we can check our IP address using the following command.

All our work is done.

Vmware Attempting to Start Up From

To start a newly created virtual machine, we got an error like following image.

VM failed to boot or VM failed to load from hard drive or CDROM. If the firmware type of VM is selected as "UEFI", then this error message will be appeared. Just like as following image:-


To resolve this issue, simply just change the firmware type to "BIOS". Then everything will be okey.

Step by step process is shown below:-

First of all, we have to edit the virtual machine settings. To edit the settings, select "Edit virtual machine settings".


Now go to "Option" tab from virtual machine settings.


click on "Advanced" and change "Firmware type" to "BIOS". 



Finally click on "OK". Run your virtual machine again. Hopefully it will start new VM without any error.

Mikrotik Netwatch Auto Failover

Netwatch tool, that monitors the status of a network or a link. At a certain point in time, this tool sends a ping request to a predefined network or a link. If for some reason this tool does not receive a ping response from that link or network, it sends a notification in the form of email or SMS to the system admin or user. Or maybe re-route the traffic to a different ISP or gateway.

Whenever there is a change detected in the status of the link, related action will be taken. The Netwatch tool performs this task with the help of some scripts. Whenever there is a change in the status of the link, the script related to that status will be started.

In this tutorial, we will discuss how to re-route traffic to a secondary ISP or gateway if the primary ISP or gateway gets down. At the same time, we will be discussing how to get back to the primary ISP or gateway if it comes back.

At this point, we already know that the “Netwatch” tool can monitor a gateway status or a server link by pinging that device that is located on the internet. If for any reason that link or server goes down, then this tool will disable the failed gateway link and at the same, it will enable the secondary gateway link. All the things will be done by executing the script which we have to be configured into the Netwatch tool.

In this case, no matter which link is down, it may be our router to ISP-1 link or it may be ISP-1 to their gateway link, the router will switch to secondary ISP automatically.

Now we will discuss the script that, the “Netwatch” tool will execute if the primary gateway goes down. We assume that our primary ISP gateway address is 1.1.1.1 and our secondary ISP gateway address is 2.2.2.2. We are assuming more that, the Netwatch tool will continuously send ping requests to the 8.8.8.8 server that is located on the internet using the primary ISP gateway. Also, it will send a ping request to the 8.8.4.4 server using a secondary ISP gateway. If for some reason, it didn’t get any ping response from those servers between specific periods of time, then it will disable that specific gateway. Means, If the Netwatch tool didn't get a response from the 8.8.8.8 server, then it will disable the ISP-1 gateway which is 1.1.1.1 and in the same way, if it didn't get a response from the 8.8.4.4 server, then it will disable the second ISP gateway, which is 2.2.2.2. After getting a response, it will enable it automatically. 

At this point, we will add two more routes to trace the link status of ISP-1 and ISP-2. We will send 8.8.8.8 traffic via ISP-1 and 8.8.4.4 traffic via ISP-2.

To trace the ISP-1 link we will add the following route

To trace the ISP-2 link we will add the following route



Now we will go for a script.

The script for disabling primary route:-

ip route disable [find gateway="1.1.1.1"]

[Note:- If we use any comment for primary gateway entry than here we can use that comment for disabling that gateway]

ip route disable [find comment=”write_your_comment”]

For example:- ip route disable [find comment=”backup route”]

or

ip route disable [/ip route find comment="my comment"]

For example:- ip route disable [/ip route find comment="backup route"]


In the same way, the script for enabling secondary route:-

ip route enable [find gateway="2.2.2.2"]

or

ip route enable [find comment=”write_your_comment”]

For example:- ip route enable [find comment=”backup route”]

or

ip route enable [/ip route find comment="my comment"]

For example:- ip route enable [/ip route find comment="backup route"]


How to configure those script into the Netwatch tool, is shown using the picture below:-

First of all, we will open the Netwatch tool and create a rule.



Now we will create a rule and there we have to write our target server address 8.8.8.8 at the “Host” field. The rest of the things will be the default. It will send requests using our primary gateway means 1.1.1.1.


Now click on the “Down” tab and there we have to write the below code:-

ip route disable [find gateway="1.1.1.1"]

When the Netwatch tool didn't get a response from the 8.8.8.8 server, then this script will be executed. As a script, 1.1.1.1 gateway will be disabled.


Now we will go to the “Up” tab and have to write the below code:-

ip route enable [find gateway="1.1.1.1"]

When it starts getting a response from the 8.8.8.8 server, then this script will be executed. As a script  1.1.1.1 gateway will be activated.


One more thing that we have to do is, disable the associate NAT entry for that route. Because, if the NAT entry is enabled for that route, all requested traffic is going to be translated, and then it will forward to the gateway that is already disabled by the Netwatch script. As a result, all traffic should be dropped.

To disable the associate NAT we have to run another script as a part of Netwach action. We can run multiple scripts for a single Netwatch entry or we can add multiple Netwatch entries for associating that multiple scripts. Here we will use the multiple Netwach entries method.

Now we will add another entry for the 8.8.8.8 server.


Now we will go to the "Up" tab and have to write the below code:-

ip firewall nat enable numbers=0

Here, the "numbers" parameter value is represented the serial number of the NAT entry. That is:-


The script "numbers" value should be the same as your NAT entry serial number. In this example, we used 0 because of which NAT entry we are going to be disabled that NAT entry serial number is 0.


Now for the "Down" tab. Have to write the below code:-

ip firewall nat disable numbers=0


From now on, if the primary link gets down then our primary route should be disabled as well as that associate NAT should be disabled. If the link gets back, then this route entry and NAT entry would be enabled again. 

Now we will add an entry for the 8.8.4.4 server. Add a new rule and write your server address means 8.8.4.4. It will send a ping request using the second ISP means 2.2.2.2.


Now click on the “Down” tab and have to write the below code:-

ip route disable [find gateway="2.2.2.2"]

When the Netwatch tool didn't get a response from the 8.8.4.4 server, then this script will be executed. As a script, 2.2.2.2 gateway will be disabled.


Now we will go to the “Up” tab and have to write the below code:-

ip route enable [find gateway="2.2.2.2"]

When it starts getting a response from the 8.8.4.4 server, then this script will be executed. As a script,  2.2.2.2 gateway will be activated.

Now, will add another entry for disabling NAT associate of that specific gateway.


Have to write the below code to the "Up" tab.

ip firewall nat enable numbers=1

Here, we used the "numbers" parameter value 1 because the serial number for that NAT entry is 1.



Now we will have to write code for the "Down" tab.

ip firewall nat disable numbers=1


Finally, click on “Apply” and then “OK”.

Another important thing we have required to complete. If our primary link gets down then our 8.8.8.8 server should be stopped receive a response from it. Otherwise, it will not execute any code that we have written. Generally, When our Mikrotik router can't reach the 8.8.8.8 server via our primary gateway means 1.1.1.1 then it will try to reach that 8.8.8.8 server via secondary gateway means 2.2.2.2. And this time the Mikrotik router should succeed. It can reach it using a secondary gateway. That's why it will not execute any script because the link is reachable. 

That's why we have to stop the Mikrotik router to reach the 8.8.8.8 server using a secondary gateway. We can do this using the firewall rule. We will create a rule that drops all the connections to reach the 8.8.8.8 server using a secondary gateway. The rule is as follows:-

ip firewall filter add chain=output dst-address=8.8.8.8 protocol=icmp out-interface=ether7 action=drop

It will be the same for the 8.8.4.4 server.

ip firewall filter add chain=output dst-address=8.8.4.4 protocol=icmp out-interface=ether8 action=drop


In this example, we are connected to the second ISP via the Ether7 interface. That's why we select ether7 as our output interface. And for the 8.8.4.4 server we have select out-interface ether8 because this interface is connected to our primary ISP.

From now on, if the "Netwatch" tool didn't get a ping response from the 8.8.8.8 server or 8.8.4.4 server, then it will execute those script. No matter which link is down whether it's our link or it's our ISP link, it will switch automatically. At the same time, when our primary ISP or gateway gets back, then our secondary ISP or gateway will be set as backed up automatically and our primary ISP will be activated.