# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://training-team.gitbook.io/setting-up-cloudera-data-platform-cdp/configuring-network-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
