Red Hat Server Network Configuration

  • Setting the IPAddress, DNS,

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
BROADCAST=***.**.**.255
IPADDR=139.**.**.*** NETMASK=255.255.255.0
NETWORK=***.**.**.0
ONBOOT=yes
DNS1=***.**.**.*
DNS2=***.**.**.*
TYPE=Ethernet
GATEWAY=***.**.**.10
HWADDR=00:**:**:**:**:65
PEERDNS=yes

Setting the PEERDNS to yes allows the system to modify /etc/resolv.conf if the DNS directive is set above.
This file can be viewed by typing
vi /etc/resolv.conf
The file should look like this

search domain.edu.au (domain goes on this line)
nameserver ***.**.**.*
nameserver ***.**.**.*

  • To restart the newtork type /etc/init.d/network restart
  • Once the IP and internal name were set up as the initial DNS entry we updated the etc/hosts file

127.0.0.1 localhost.localdomain localhost internalname

This allows the machine to resolve localhost and internal name with out a DNS server

  • To open ports

go to

/etc/sysconfig

then

su root

vi iptables

add the following line putting the port number where it says to

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport port number -j ACCEPT

save and exit

restart the network service by typing

service iptables restart

All done

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s