MacVTap
How to create a MacVTap.
Boundary conditions:
- libvirt will automatically create a MacVTap interface when you configure a direct connection.
- lsmod | grep macvtap
- lsmod | grep bonding
[root@kvm1awb images]# lsmod | grep macvtap
macvtap 22693 1 vhost_net
macvlan 19150 1 macvtap
[root@kvm1awb images]# lsmod | grep bonding
[root@kvm1awb images]# modprobe bonding
[root@kvm1awb images]# lsmod | grep bonding
bonding 160781 0
Step-by-step process:
- Create a network interface
1.1 To find a interface name of a qeth device lsqeth -p
1.2 znetconf -u
1.3 znetconf -c
1.4
# ip addr add <IP-address> dev <network-interface-name>
# ip link set <network-interface-name> up
1.5
ip link set <network-interface-name> qlen 2500
- Create a bond interface for high availability
1.1 Add a new bonded interface dinamically 1.2 Verify the existing bond interfaces
[root@kvm1awb /]# cat /sys/class/net/bonding_masters
bond0
1.3 Let's create the bond5
[root@kvm1awb /]# echo "+bond5" > /sys/class/net/bonding_masters
[root@kvm1awb /]# cat /sys/class/net/bonding_masters
bond0 bond5
[root@kvm1awb /]# ip link show bond5
22: bond5: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN mode DEFAULT
link/ether 86:91:ae:e0:8a:98 brd ff:ff:ff:ff:ff:ff
[root@kvm1awb /]#
1.4 Specify some bonding parameters
Questions: what is the default? balance-rr ?
[root@kvm1awb /]# echo "active-backup 1" > /sys/class/net/bond5/bonding/mode
[root@kvm1awb /]# echo "100" > /sys/class/net/bond5/bonding/miimon
[root@kvm1awb /]# echo "active 1" > /sys/class/net/bond5/bonding/fail_over_mac
[root@kvm1awb /]# cd /sys/class/net/bond5/bonding/
[root@kvm1awb bonding]# ls
active_slave ad_partner_key arp_interval fail_over_mac min_links primary slaves
ad_actor_key ad_partner_mac arp_ip_target lacp_rate mode primary_reselect updelay
ad_aggregator ad_select arp_validate miimon num_grat_arp queue_id use_carrier
ad_num_ports all_slaves_active downdelay mii_status num_unsol_na resend_igmp xmit_hash_policy
[root@kvm1awb bonding]# cat fail_over_mac
active 1
[root@kvm1awb bonding]# cat miimon
100
[root@kvm1awb bonding]# cat mode
active-backup 1
1.5 Add the network interfaces on the KVM Host
[root@kvm1awb bonding]# znetconf -a 4100 -o layer2=1
Scanning for network devices...
Successfully configured device 0.0.4100 (enccw0.0.4100)
[root@kvm1awb bonding]# znetconf -a 4103 -o layer2=1
Scanning for network devices...
Successfully configured device 0.0.4103 (enccw0.0.4103)
[root@kvm1awb bonding]# znetconf -a 5703 -o layer2=1
Scanning for network devices...
Successfully configured device 0.0.5703 (enccw0.0.5703)
[root@kvm1awb bonding]# znetconf -c
Device IDs Type Card Type CHPID Drv. Name State
--------------------------------------------------------------------------------
0.0.4100,0.0.4101,0.0.4102 1731/01 OSD_1000 01 qeth enccw0.0.4100 online
0.0.4103,0.0.4104,0.0.4105 1731/01 OSD_1000 01 qeth enccw0.0.4103 online
0.0.5703,0.0.5704,0.0.5705 1731/01 OSD_1000 0C qeth enccw0.0.5703 online
0.0.570a,0.0.570b,0.0.570c 1731/01 OSD_1000 0C qeth enccw0.0.570a online
1.6 Add slaves interfaces
If you try to execute this command without follow the steps 1.x, you will receive an error:
# ip link set enccw0.0.4100 master bond5
RTNETLINK answers: Operation not permitted
- Optional: Create a virtual LAN (VLAN) interface.