Fast2Host Logo

Linux

Configure IP Networking

Centos based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit

  vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME="my.domainname.com"
GATEWAY="111.222.333.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"

 

 

TCP/IP Network Configuration Files

This configures Linux so that it knows which DNS server will be resolving domain names into IP addresses

  vi /etc/resolv.conf

 

search name-of-domain.com - Name of your domain or ISP's domain if using their name server
nameserver XXX.XXX.XXX.XXX - IP address of primary name server
nameserver XXX.XXX.XXX.XXX - IP address of secondary name server

Locally resolve node names to IP addresses

vi /etc/hosts

 

::1             localhost6.localdomain6 localhost6
# Do not remove the following line, or various programs
# that require network functionality will fail.
111.222.333.444            yourname.server.com yourname
127.0.0.1               localhost

 

Configuration settings for your first ethernet port

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

 

DEVICE=eth0
BOOTPROTO=static
BROADCAST=111.222.333.255
IPADDR=111.222.333.444
NETMASK=255.255.255.0
NETWORK=111.222.333.0
ONBOOT=yes
GATEWAY=111.222.333.1
 

Then you need to restart your network

 

service network restart



Maintain peace of mind with UK based support

Email any time or call 01480 26 00 00 014 80 26 00 00