> For the complete documentation index, see [llms.txt](https://training-team.gitbook.io/setting-up-cloudera-data-platform-cdp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://training-team.gitbook.io/setting-up-cloudera-data-platform-cdp/configuring-network-settings.md).

# Configuring Network Settings

### **Configuring Selinux** <a href="#id-2l60z5rio9wd" id="id-2l60z5rio9wd"></a>

You’ll have to set Selinux mode to **“disabled”** by configuring the selinux file located in /etc/sysconfig directory.

Open the file and make changes:-

```
sudo vi /etc/sysconfig/selinux
```

Update the following line:-

```
SELINUX=disabled
```

![](/files/hfVafSb5YwTTxNNOq9LY)

Save the file and exit.

**Reboot the machine.**

```
sudo reboot
```

### **Disabling the Firewall** <a href="#e15j9hnd8vpv" id="e15j9hnd8vpv"></a>

To disable the firewall on each host in your cluster, perform the following steps on each host.

For iptables, save the existing rule set:

```
sudo iptables-save > ~/firewall.rules
```

**Disable the firewall:**

**RHEL 7 compatible:**

```
sudo systemctl disable firewalld
sudo systemctl stop firewalld
```

### **Set Static Hostname and edit Network Configuration** <a href="#toukpgl5q8vl" id="toukpgl5q8vl"></a>

```
sudo hostnamectl set-hostname datacouch.training.io --static
```

Now verify…

```
hostname -f
```

Create and edit a file /usr/sbin/hosts.sh and set it executable

```
sudo touch /usr/sbin/hosts.sh
sudo chmod 755 /usr/sbin/hosts.sh
sudo vi /usr/sbin/hosts.sh
```

Paste the below script in `hosts.sh`

```
#!/bin/sh
#
# Script to determine the FQDN of a node in GCP and update hosts file
#
sudo hostnamectl set-hostname datacouch.training.io --static
myhost=`hostname -f`
ipaddr=`ifconfig eth0 | grep "inet " | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | head -1`
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts.latest
echo $ipaddr ' ' $myhost >> /etc/hosts.latest
mv /etc/hosts /etc/hosts.old
mv /etc/hosts.latest /etc/hosts
```

Edit rc.local to run the hosts.sh script at boot for CentOS 7+, rc.local is not set as executable by default!

```
sudo chmod +x /etc/rc.d/rc.local
sudo systemctl enable rc-local
sudo systemctl start rc-local
```

Add below command inside ***`/etc/rc.d/rc.local`***

```
sudo sh /usr/sbin/hosts.sh
```
