I have a Dell XPS 13 ultrabook which has a wifi nic, but no physical ethernet nic (wlan0, but no eth0). I need to create a virtual adapter for using Vagrant with NFS, but am finding that the typical ifup eth0:1...
fails with ignoring unknown interface eth0:1=eth0:1
. I also tried creating a virtual interface against wlan0
, but received the same result.
How can I create a virtual interface on this machine with no physical interface?
Best Answer
Setting up a dummy interface
If you want to create network interfaces, but lack a physical NIC to back it, you can use the dummy link type. You can read more about them here: iproute2 Wikipedia page.
Creating eth10
To make this interface you'd first need to make sure that you have the dummy kernel module loaded. You can do this like so:
With the driver now loaded you can create what ever dummy network interfaces you like:
NOTE: In older versions of
ip
you'd do the above like this, appears to have changed along the way. Keeping this here for reference purposes, but based on feedback via comments, the above works now.And confirm it:
Changing the MAC
You can then change the MAC address if you like:
Creating an alias
You can then create aliases on top of eth10.
And confirm them like so:
Or using
ip
:Removing all this?
If you want to unwind all this you can run these commands to do so:
References