How To Setup Network For IBM-AIX VM Access in QEMU.
Updated: Oct 3, 2021
Previously, , I have posted how we can create a VMs in my laptop and install AIX Operating System in that VM. Now we need to established the network connectivity. So that my AIX VM gets network access with the help of the hypervisor.
In my laptop, I have two bridge interface,
br0: it is a network bridge device based on the default route of br0, gets device eth0 instead of device br0.
virbr0: "Virtual Bridge0" interface is used by guests VMs that are set up to use NAT networking, and route it to eth0 as well.
As we have installed qemu the full-system emulation of the IBM Power System on my laptop. So we need to create the virtual interface, and a link between the the virtual interface and the bridge interface for the network connectivity. as below.
Note: en0 is the network interface name inside the AIX Operating System, as like the eth0 is the default network interface in RHEL Operating System.
There is a device called tap device that will create a link between the the virtual interface and the bridge interface. And a network TAP (Test Access Point) is a hardware tool that allows you to access and monitor your network.
Let's create the tap device and established the network connectivity.
Required Network Configuration for My Laptop:
Step:1 To create vnet10 interface.
# ip tuntap add vnet10 mode tap
vnet10 tap interface name is available to create in my laptop, we can check where it is available or not by # ip tuntap show command.
Step:2 To bring up vnet10 interface
# ip link set vnet10 up
Step:3 To enable proxy arp on vnet10
# echo 1 > /proc/sys/net/ipv4/conf/vnet10/proxy_arp
Step:4 To setup routing for 192.168.122.199
# ip route add 192.168.122.99 dev vnet10
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 600 0 0 wlan0
10.0.0.0 10.67.116.1 255.0.0.0 UG 50 0 0 tun0
10.67.116.0 0.0.0.0 255.255.252.0 U 50 0 0 tun0
192.168.0.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
192.168.0.1 0.0.0.0 255.255.255.255 UH 600 0 0 wlan0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
192.168.122.99 0.0.0.0 255.255.255.255 UH 0 0 0 vnet10
Note: alternatively, instead of create a route for vnet10, we can attach the vnet10 interface to the virbr0 bridge, as below.
# brctl addif virbr0 vnet10
# brctl show virbr0
Step:5 To broadcast ARP for AIX VM IP Address.
# arp -Ds 192.168.122.99 virbr0 pub
Required Network Configuration for AIX VM:
Step:1 Now, we need boot our AIX VMs from the hdisk0 along with the network tap device, as below.
# /usr/local/bin/qemu-system-ppc64 -cpu POWER8 -machine pseries -m 8192 -serial stdio \
-drive file=/mnt/hdisk0.qcow2,if=none,id=drive-virtio-disk0 \
-device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \
-cdrom /mnt/AIX7.2TL03D1.ISO -prom-env "boot-command=boot disk:" \
-net nic,macaddr=52:54:00:30:31:32 -net tap,script=no,ifname=vnet10
Step:2 To set IP Address on network interface in the AIX VM, as below:
# chdev -l en0 -a netaddr=192.168.122.99 -a netmask=255.255.255.0 -a state=up
# chdev -l inet0 -a route=0,192.168.122.1
# ping -c1 192.168.122.1
Note: we can use smitty tcpip command to to set IP Address on network interface in the AIX VM.
To Access AIX VM from My Laptop:
By default, telnet service is up and running in the AIX OS, Lets try with telnet command to connect.
# telnet 192.168.122.99
AIX Version 7
Copyright IBM Corporation, 1982, 2018.
login: root
root's Password:
*******************************************************************************
* *
* *
* Welcome to AIX Version 7.2! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
Last unsuccessful login: Fri Aug 7 00:21:00 +08 2020 on /dev/vty0
Last login: Fri Aug 7 00:37:09 +08 2020 on /dev/pts/0 from 192.168.0.189
#
Okay, Networking works fine.
To verify the internet connectivity, as will.
# ping 8.8.8.8
PING 8.8.8.8: (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=117 time=82 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=22 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 22/52/82 ms
wow, its works fine as well.
To Run AIX VM In Background:
Every time we have to execute the command to start the AIX VM and the command will hold your current console. we can start AIX VM in the background without a console can be used. as below.
# /usr/local/bin/qemu-system-ppc64 -cpu POWER8 -machine pseries -m 8192 \
-drive file=/mnt/hdisk0.qcow2,if=none,id=drive-virtio-disk0 \
-device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \
-cdrom /mnt/AIX7.2TL03D1.ISO -prom-env "boot-command=boot disk:" \
-net nic,macaddr=52:54:00:30:31:32 -net tap,script=no,ifname=vnet10 -daemonize
Run a ping command to 192.168.122.99 from any console and wait for the AIX VM Up. see you in my next post.
Comentarios