Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hardcoded DNS servers #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion http/generic.alpine310.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine310.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.10/main"
Expand Down
1 change: 0 additions & 1 deletion http/generic.alpine35.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine35.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.5/main"
Expand Down
1 change: 0 additions & 1 deletion http/generic.alpine36.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine36.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.6/main"
Expand Down
1 change: 0 additions & 1 deletion http/generic.alpine37.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine37.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.7/main"
Expand Down
1 change: 0 additions & 1 deletion http/generic.alpine38.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine38.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.8/main"
Expand Down
1 change: 0 additions & 1 deletion http/generic.alpine39.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname alpine39.localdomain
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.9/main"
Expand Down
6 changes: 0 additions & 6 deletions http/generic.dragonflybsd5.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ hostname="${HOSTNAME}"
dumpdev="/dev/${DISK}s1b"
EOF

cat <<-EOF > /mnt/etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install sed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install curl
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install sudo
Expand Down
7 changes: 0 additions & 7 deletions http/generic.freebsd11.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ HOSTNAME=freebsd11.localdomain
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"

#!/bin/sh
cat <<EOF > /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install curl
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sudo
Expand Down
7 changes: 0 additions & 7 deletions http/generic.freebsd12.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ HOSTNAME=freebsd12.localdomain
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"

#!/bin/sh
cat <<EOF > /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install curl
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sudo
Expand Down
7 changes: 0 additions & 7 deletions http/generic.hardenedbsd11.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ HOSTNAME=hardenedbsd11.localdomain
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"

#!/bin/sh
cat <<EOF > /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

mkdir -p /usr/local/etc/pkg/repos
echo "FreeBSD: { enabled: yes }" > /usr/local/etc/pkg/repos/FreeBSD.conf

Expand Down
7 changes: 0 additions & 7 deletions http/generic.hardenedbsd12.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ HOSTNAME=hardenedbsd12.localdomain
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"

#!/bin/sh
cat <<EOF > /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

mkdir -p /usr/local/etc/pkg/repos
echo "FreeBSD: { enabled: yes }" > /usr/local/etc/pkg/repos/FreeBSD.conf

Expand Down
1 change: 0 additions & 1 deletion http/magma.alpine35.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname magma.builder
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.5/main"
Expand Down
1 change: 0 additions & 1 deletion http/magma.alpine36.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ auto eth0
iface eth0 inet dhcp
hostname magma.builder
"
DNSOPTS="-d local -n 4.2.2.1 4.2.2.2 208.67.220.220"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="https://sjc.edge.kernel.org/alpine/v3.6/main"
Expand Down
7 changes: 0 additions & 7 deletions http/magma.freebsd11.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ HOSTNAME=magma.builder
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"

#!/bin/sh
cat <<EOF > /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install curl
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 pkg install sudo
Expand Down
11 changes: 8 additions & 3 deletions scripts/centos6/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ error() {
fi
}

# We setup permanently good DNS servers later, but we write these out directly here to make
# sure there are good ones available for the package installlation tasks below.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf
# Tell yum to retry 128 times before failing, so unattended installs don't skip packages when errors occur.
printf "\nretries=128\nmetadata_expire=0\nmirrorlist_expire=0\n" >> /etc/yum.conf

# Disable the broken repositories.
truncate --size=0 /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Vault.repo

# Import the update key.
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6; error

# Update the base install first.
retry yum --assumeyes update; error
Expand Down
8 changes: 1 addition & 7 deletions scripts/centos6/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ retry() {
return "${RESULT}"
}

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# Disable IPv6 or yum will resolve mirror names to IPv6 address and then fail to connect with them.
sysctl net.ipv6.conf.all.disable_ipv6=1

Expand Down Expand Up @@ -74,13 +71,10 @@ if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0

# Ensure good DNS servers are being used, and NM will be in control.
# Ensure NM will be in control.
sed -i -e "/NM_CONTROLLED/d" /etc/sysconfig/network-scripts/ifcfg-eth0
printf "PEERDNS=\"no\"\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "NM_CONTROLLED=\"yes\"\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "IPV4_FAILURE_FATAL=\"no\"\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Depending on the kick start configuration, the NetworkManager may still
Expand Down
3 changes: 0 additions & 3 deletions scripts/centos7/network.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash -eux

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the hostname, and then ensure it will resolve properly.
if [[ "$PACKER_BUILD_NAME" =~ ^generic-centos7-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then
printf "centos7.localdomain\n" > /etc/hostname
Expand Down
3 changes: 0 additions & 3 deletions scripts/debian10/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ error() {
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true

# We handle name server setup later, but for now, we need to ensure valid resolvers are available.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# If the apt configuration directory exists, we add our own config options.
if [ -d /etc/apt/apt.conf.d/ ]; then

Expand Down
6 changes: 0 additions & 6 deletions scripts/debian10/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ printf "allow-hotplug eth0\n" >> /etc/network/interfaces
printf "auto lo\n" >> /etc/network/interfaces
printf "iface lo inet loopback\n" >> /etc/network/interfaces
printf "iface eth0 inet dhcp\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.1\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.2\n" >> /etc/network/interfaces
printf "dns-nameserver 208.67.220.220\n" >> /etc/network/interfaces

# Adding a delay so dhclient will work properly.
printf "pre-up sleep 2\n" >> /etc/network/interfaces

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# Install ifplugd so we can monitor and auto-configure nics.
retry apt-get --assume-yes install ifplugd resolvconf

Expand Down
3 changes: 0 additions & 3 deletions scripts/debian8/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ error() {
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true

# We handle name server setup later, but for now, we need to ensure valid resolvers are available.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# If the apt configuration directory exists, we add our own config options.
if [ -d /etc/apt/apt.conf.d/ ]; then

Expand Down
6 changes: 0 additions & 6 deletions scripts/debian8/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ printf "allow-hotplug eth0\n" >> /etc/network/interfaces
printf "auto lo\n" >> /etc/network/interfaces
printf "iface lo inet loopback\n" >> /etc/network/interfaces
printf "iface eth0 inet dhcp\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.1\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.2\n" >> /etc/network/interfaces
printf "dns-nameserver 208.67.220.220\n" >> /etc/network/interfaces

# Adding a delay so dhclient will work properly.
printf "pre-up sleep 2\n" >> /etc/network/interfaces

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# Install ifplugd so we can monitor and auto-configure nics.
retry apt-get --assume-yes install ifplugd resolvconf

Expand Down
3 changes: 0 additions & 3 deletions scripts/debian9/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ error() {
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true

# We handle name server setup later, but for now, we need to ensure valid resolvers are available.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# If the apt configuration directory exists, we add our own config options.
if [ -d /etc/apt/apt.conf.d/ ]; then

Expand Down
6 changes: 0 additions & 6 deletions scripts/debian9/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ printf "allow-hotplug eth0\n" >> /etc/network/interfaces
printf "auto lo\n" >> /etc/network/interfaces
printf "iface lo inet loopback\n" >> /etc/network/interfaces
printf "iface eth0 inet dhcp\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.1\n" >> /etc/network/interfaces
printf "dns-nameserver 4.2.2.2\n" >> /etc/network/interfaces
printf "dns-nameserver 208.67.220.220\n" >> /etc/network/interfaces

# Adding a delay so dhclient will work properly.
printf "pre-up sleep 2\n" >> /etc/network/interfaces

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n" > /etc/resolv.conf

# Install ifplugd so we can monitor and auto-configure nics.
retry apt-get --assume-yes install ifplugd resolvconf

Expand Down
10 changes: 0 additions & 10 deletions scripts/fedora25/base.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the local hostname to resolve properly.
printf "\n127.0.0.1 bazinga.localdomain\n\n" >> /etc/hosts

Expand All @@ -28,13 +25,6 @@ sed -i -e "/IPV6_PEERROUTES.*/d;$ a IPV6_PEERROUTES=no" /etc/sysconfig/network-s
sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0


# Ensure good DNS servers are being used.
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Close a potential security hole.
systemctl disable remote-fs.target

Expand Down
10 changes: 0 additions & 10 deletions scripts/fedora26/base.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the local hostname to resolve properly.
printf "\n127.0.0.1 bazinga.localdomain\n\n" >> /etc/hosts

Expand All @@ -28,13 +25,6 @@ sed -i -e "/IPV6_PEERROUTES.*/d;$ a IPV6_PEERROUTES=no" /etc/sysconfig/network-s
sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0


# Ensure good DNS servers are being used.
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Close a potential security hole.
systemctl disable remote-fs.target

Expand Down
9 changes: 0 additions & 9 deletions scripts/fedora27/base.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the local hostname to resolve properly.
printf "\n127.0.0.1 magma.builder\n\n" >> /etc/hosts

Expand All @@ -29,12 +26,6 @@ sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scr
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0


# Ensure good DNS servers are being used.
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Close a potential security hole.
systemctl disable remote-fs.target

Expand Down
10 changes: 0 additions & 10 deletions scripts/fedora28/base.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the local hostname to resolve properly.
printf "\n127.0.0.1 magma.builder\n\n" >> /etc/hosts

Expand All @@ -28,13 +25,6 @@ sed -i -e "/IPV6_PEERROUTES.*/d;$ a IPV6_PEERROUTES=no" /etc/sysconfig/network-s
sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0


# Ensure good DNS servers are being used.
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Close a potential security hole.
systemctl disable remote-fs.target

Expand Down
10 changes: 0 additions & 10 deletions scripts/fedora29/base.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# Ensure a nameserver is being used that won't return an IP for non-existent domain names.
printf "nameserver 4.2.2.1\nnameserver 4.2.2.2\nnameserver 208.67.220.220\n"> /etc/resolv.conf

# Set the local hostname to resolve properly.
printf "\n127.0.0.1 magma.builder\n\n" >> /etc/hosts

Expand All @@ -28,13 +25,6 @@ sed -i -e "/IPV6_PEERROUTES.*/d;$ a IPV6_PEERROUTES=no" /etc/sysconfig/network-s
sed -i -e "/IPV6FORWARDING.*/d;$ a IPV6FORWARDING=no" /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e "/IPV6_AUTOTUNNEL.*/d;$ a IPV6_AUTOTUNNEL=no" /etc/sysconfig/network-scripts/ifcfg-eth0


# Ensure good DNS servers are being used.
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
printf "DNS1=4.2.2.1\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
printf "DNS2=4.2.2.2\n" >> /etc/sysconfig/network-scripts/ifcfg-eth0
fi

# Close a potential security hole.
systemctl disable remote-fs.target

Expand Down
Loading