Advertisement

Friday, March 3, 2017

Oracle Database - Grid Infrastructure / RAC 12c Installation - Part 3 - Network Configuration (OEL 7.1)

 

In this blog we are going to work on network configuration.

I will -

  1. Setup Network interfaces / IP addresses and enable them
  2. Setup a DNS Server
  3. Setup /etc/hosts file

Below is what is going to be my network configuration.


I have added another entry for Node 3. However we are going to do only 2-Node Installation

Below are my network entries for my interfaces.
Note - that with Predictable nomenclature of network interfaces the conventional names such as eth0, eth1 are not used. (though it is still possible to use them by mapping them in udev.rules)



cd /etc/sysconfig/network-scripts
cat ifcfg-enp0s3
DEVICE=enp0s3

BOOTPROTO=none
ONBOOT=yes
NETWORK=10.10.10.0
NETMASK=255.255.255.0
IPADDR=10.10.10.1
USERCTL=no

cat ifcfg-enp0s8
DEVICE=enp0s8
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.0.0
NETMASK=255.255.255.0
IPADDR=192.168.0.1
USERCTL=no


cat ifcfg-enp0s9
DEVICE=enp0s9
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.1.0
NETMASK=255.255.255.0
IPADDR=192.168.1.1
USERCTL=no

cat ifcfg-enp0s10
DEVICE=enp0s10
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.10.0
NETMASK=255.255.255.0
IPADDR=192.168.10.1
USERCTL=no

Start all the interfaces now
ifup enp0s3
ifup enp0s8
ifup enp0s9
ifup enp0s1 

Once the interfaces are started, they can be verified using ifconfig command. 

DNS - Server Configuration

Do the below configuration
File - /etc/named.conf - Make the changes as given below

Change 1  - Add highlighted entry
options {
        listen-on port 53 { 127.0.0.1;10.10.10.1; };  <<- Add the highlighted entry  in bold

allow-query     { 10.10.10.0/24; };  <-- Make these changes in the files in bold

Change 2 - remove the below section
zone "." IN {
type hint;
file "named.ca";
};

Change 3 -  and add this in the end of the file

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

Create file /var/named/localdomain.zone with contents as below

cat /var/named/localdomain.zone

$TTL  86400
@ IN SOA      localdomain. localdomain.(
42          ; serial (d. adams)
3H          ; refresh
15M         ; retry
1W          ; expiry
1D )        ; minimum

                                 IN NS   rac1.localdomain.
localhost                        IN A    127.0.0.1
rac1.localdomain.                IN A    10.10.10.1
rac2.localdomain.                IN A    10.10.10.2
rac3.localdomain.                IN A    10.10.10.3
rac1-vip.localdomain.            IN A    10.10.10.4
rac2-vip.localdomain.            IN A    10.10.10.5
rac3-vip.localdomain.            IN A    10.10.10.6
rac-scan.localdomain.            IN A    10.10.10.7
rac-scan.localdomain.            IN A    10.10.10.8
rac-scan.localdomain.            IN A    10.10.10.9

File - /etc/resolv.conf - create this file as below 

[root@rac1 network-scripts]# cat /etc/resolv.conf

nameserver 10.10.10.1

search localdomain
domain localdomain

options attempts:1

options timeout:1

Finally enable the named.service and restart it
Note - the systemctl utiltity used instead of conventional chkconfig and service utility

systemctl enable named.service
systemctl restart named.service

[root@rac1 network-scripts]# systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
   Active: active (running) since Fri 2017-03-03 13:49:53 IST; 2min 47s ago
 Main PID: 5736 (named)
   CGroup: /system.slice/named.service
           └─5736 /usr/sbin/named -u named

Mar 03 13:49:53 rac1.localdomain named[5736]: zone 0.in-addr.arpa/IN: loaded serial 0
Mar 03 13:49:53 rac1.localdomain named[5736]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Mar 03 13:49:53 rac1.localdomain named[5736]: zone localdomain/IN: loaded serial 42
Mar 03 13:49:53 rac1.localdomain named[5736]: zone localhost.localdomain/IN: loaded serial 0
Mar 03 13:49:53 rac1.localdomain named[5736]: zone localhost/IN: loaded serial 0
Mar 03 13:49:53 rac1.localdomain named[5736]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Mar 03 13:49:53 rac1.localdomain named[5736]: all zones loaded
Mar 03 13:49:53 rac1.localdomain named[5736]: running
Mar 03 13:49:53 rac1.localdomain systemd[1]: Started Berkeley Internet Name Domain (DNS).
Mar 03 13:49:53 rac1.localdomain named[5736]: zone localdomain/IN: sending notifies (serial 42)

File - /etc/hosts Create the file /etc/hosts as below 

cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.1 rac1.localdomain rac1
10.10.10.2 rac2.localdomain rac2
10.10.10.3 rac3.localdomain rac3

10.10.10.4 rac1-vip.localdomain rac1-vip
10.10.10.5 rac2-vip.localdomain rac2-vip
10.10.10.6 rac3-vip.localdomain rac3-vip

192.168.0.1 rac1-priv1
192.168.0.2 rac2-priv1
192.168.0.3 rac3-priv1

192.168.1.1 rac1-priv2 
192.168.1.2 rac2-priv2
192.168.1.3 rac3-priv2

192.168.10.1 rac1-priv3
192.168.10.2 rac2-priv3
192.168.10.3 rac3-priv3


Verify DNS Server using nslookup
[root@rac1 network-scripts]# nslookup rac-scan
Server: 10.10.10.1
Address: 10.10.10.1#53

Name: rac-scan.localdomain
Address: 10.10.10.9
Name: rac-scan.localdomain
Address: 10.10.10.7
Name: rac-scan.localdomain
Address: 10.10.10.8

[root@rac1 network-scripts]# nslookup rac1
Server: 10.10.10.1
Address: 10.10.10.1#53

Name: rac1.localdomain
Address: 10.10.10.1

[root@rac1 network-scripts]# nslookup rac3
Server: 10.10.10.1
Address: 10.10.10.1#53

Name: rac3.localdomain
Address: 10.10.10.3

Finally set selinux to permissive and disable iptables service from reboot the system

vi /etc/selinux/config 
set
SELINUX=permissive

systemctl disable iptables.service
systemctl disable firewalld

No comments:
Write comments