Product SiteDocumentation Site

4.2.2. Configure Guest Network

Run the commands below to set up a static ip address (192.168.122.10) and hostname (guest1).
export remote_hostname=guest1
export remote_ip=192.168.122.10
export remote_gateway=192.168.122.1

yum remove -y NetworkManager

rm -f /etc/hostname
cat << END >> /etc/hostname
$remote_hostname
END

hostname $remote_hostname

cat << END >> /etc/sysconfig/network
HOSTNAME=$remote_hostname
GATEWAY=$remote_gateway
END

sed -i.bak "s/.*BOOTPROTO=.*/BOOTPROTO=none/g" /etc/sysconfig/network-scripts/ifcfg-eth0

cat << END >> /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR0=$remote_ip
PREFIX0=24
GATEWAY0=$remote_gateway
DNS1=$remote_gateway
END

systemctl restart network
systemctl enable network.service
systemctl enable sshd
systemctl start sshd

echo "checking connectivity"
ping www.google.com
To simplify the tutorial we’ll go ahead and disable selinux on the guest. We’ll also need to poke a hole through the firewall on port 3121 (the default port for pacemaker_remote) so the host can contact the guest.
# setenforce 0
# sed -i.bak "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config

# firewall-cmd --add-port 3121/tcp --permanent
If you still encounter connection issues, just disable firewalld on the guest like we did on the host, to guarantee you’ll be able to contact the guest from the host.
At this point you should be able to ssh into the guest from the host.