Jump to Navigation

122 - Network Configuration Files

You can change the network configuration by editing a few files.

1. CentOS & RedHat OS

Host Name : /etc/sysconfig/network

Network Device : /etc/sysconfig/networking/devices/ifcfg-eth0  ifcfg-eth1

Host Name List : /etc/hosts

DNS Server : /etc/resolve.conf

DNS Files NIS : /etc/nsswitch.conf

After editing files, you need to execute the follwoing command :

# service network restart

2. ubuntu

Network Interface : /etc/network/interfaces

Exsample:

# The primary network interface – use DHCP to find our address
auto eth0
iface eth0 inet dhcp
# The primary network interface

auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

DNS Server : /etc/resolv.conf

After editing files, you need to execute the follwoing command :

# sudo /etc/init.d/networking restart

 

 



Main menu 2

Story | by Dr. Radut