Re: How to create a simple tap0 interface using nmcli



Thnx.  So lets say I previously created a bridge interface and linked in my eth0:
$ nmcli connection show
$ nmcli connection delete <eth0|eth0-UUID>
$ nmcli connection add type bridge \
         ifname br0 con-name br0
$ nmcli connection add type bridge-slave \
         ifname eth0 con-name eth0 master br0

Presumably I create tap0 then add it to my br0 such as the following:

$ nmcli connection add type tun \

          ifname tap0 con-name tap0 \

          mode tap owner `id -u` ip4 0.0.0.0/24

$ nmcli connection add type bridge-slave \
          ifname tap0 con-name tap0 master br0

Then I would be good to go with qemu and be all-set "automagically" at every reboot as autoconnect=yes is set by default.

NM1.2 not yet available under Ubuntu 16.04 alpha (duno if planned to be included?) so can't test it unless I recompile from source.  Therefore in the meantime it's more of a personnal knowledge thing than anything else.

Thnx in advance!

- vin

Le lun. 25 janv. 2016 à 03:22, Beniamino Galvani <bgalvani redhat com> a écrit :
On Mon, Jan 25, 2016 at 02:46:54AM +0000, Vincent Fortier wrote:
> I was wondering how can I create a tap interface using nmcli?  Search again
> and again witouth luck...

Hi,

creation of tun/tap devices is supported only in NetworkManager 1.2.
On such version you can create a tap connection using the command:

 $ nmcli connection add type tun ifname tap0 con-name mytap0 \
                        mode tap owner `id -u` ip4 x.x.x.x/24

The connection will have autoconnect=yes by default and so the device
will be created automatically every time NM starts. You can manually
enable or disable the connection with:

 $ nmcli connection up mytap0
 $ nmcli connection down mytap0

Beniamino


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]