Skip to content

3.4 Networks

Sylvain Girod edited this page Jan 19, 2020 · 3 revisions

Before use network features (like netdev, spice/vnc/telnet/qmp), you must first declare it in your templates and/or Vm configs:

New_Network My-Bridge "4|10.98.98.0|24" "10.98.98.2|10.98.98.100" 10.98.98.1

where:

1st arg is IPver|network|prefix

2nd arg is range allowed for choosing a new available IP (usefull for spice/vnc/telnet/qmp)

3rd arg (optional) is the IP for this device, typically the script, will create a bridge with this ip.

Note: Networks persist in DB

Once a Network is declared, you can use it for create tuntap devices:

NETWORKDEVICE="My-Bridge|2 My-Bridge2|1"

Will create 2 tap devices added to My-Bridge device, and 1 tap device added to My-Bridge2.

Using ip a s will output like:

[...]

VM-Bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000

inet 10.98.98.1/24 scope global VM-Bridge

[...]

VM-Bridge2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000

inet 10.98.99.1/24 scope global VM-Bridge

[...]

53: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master VM-Bridge state UNKNOWN group default qlen 1000

[...]

54: tap1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master VM-Bridge state UNKNOWN group default qlen 1000

[...]

55: tap2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master VM-Bridge2 state UNKNOWN group default qlen 1000

Clone this wiki locally