From faf7e09ebbd2b9b528bab0a51019132681ccd397 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 20 Apr 2024 15:45:28 +0700 Subject: [PATCH] Only use iptable to block xml.cisco.com on Ubuntu Focal. --- scripts/remote-install.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/remote-install.sh b/scripts/remote-install.sh index 67610b53..6b4906b8 100644 --- a/scripts/remote-install.sh +++ b/scripts/remote-install.sh @@ -198,10 +198,17 @@ then dd if=/dev/zero bs=4 count=1 of=/etc/hostid # Block potential IOU phone home call (xml.cisco.com is not in use at this time) - iptables -I OUTPUT -p udp --dport 53 -m string --hex-string "|03|xml|05|cisco|03|com" --algo bm -j DROP - echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections - echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections - apt-get install -y iptables-persistent + log "Block IOU phone home call" + if [ "$UBUNTU_CODENAME" == "focal" ] + then + iptables -I OUTPUT -p udp --dport 53 -m string --hex-string "|03|xml|05|cisco|03|com" --algo bm -j DROP + echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections + echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections + apt-get install -y iptables-persistent + else + echo "127.0.0.254 xml.cisco.com" | tee --append /etc/hosts + fi + fi log "Add gns3 to the kvm group"