Created
January 23, 2020 14:10
-
-
Save mcornea/0c3d6c8a87bd245857d093157a343941 to your computer and use it in GitHub Desktop.
02_configure_host.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/02_configure_host.sh b/02_configure_host.sh | |
index 7451bbc..687f8fe 100755 | |
--- a/02_configure_host.sh | |
+++ b/02_configure_host.sh | |
@@ -104,9 +104,14 @@ if [ "$MANAGE_INT_BRIDGE" == "y" ]; then | |
# external access so we need to make sure we maintain dhcp config if its available | |
if [ "$INT_IF" ]; then | |
echo -e "DEVICE=$INT_IF\nTYPE=Ethernet\nONBOOT=yes\nNM_CONTROLLED=no\nBRIDGE=baremetal" | sudo dd of=/etc/sysconfig/network-scripts/ifcfg-$INT_IF | |
- if sudo nmap --script broadcast-dhcp-discover -e $INT_IF | grep "IP Offered" ; then | |
- grep -q BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-baremetal || (echo -e "\nBOOTPROTO=dhcp\n" | sudo tee -a /etc/sysconfig/network-scripts/ifcfg-baremetal) | |
- fi | |
+ if [[ $EXTERNAL_SUBNET =~ .*:.* ]]; then | |
+ sudo firewall-cmd --zone=libvirt --add-service=dhcpv6-client | |
+ grep -q BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-baremetal || (echo -e "BOOTPROTO=none\nIPV6INIT=yes\nIPV6_AUTOCONF=yes\nDHCPV6C=yes\nDHCPV6C_OPTIONS='-D LL'\n" | sudo tee -a /etc/sysconfig/network-scripts/ifcfg-baremetal) | |
+ else | |
+ if sudo nmap --script broadcast-dhcp-discover -e $INT_IF | grep "IP Offered" ; then | |
+ grep -q BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-baremetal || (echo -e "\nBOOTPROTO=dhcp\n" | sudo tee -a /etc/sysconfig/network-scripts/ifcfg-baremetal) | |
+ fi | |
+ fi | |
sudo systemctl restart network | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment