network interface – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Sat, 02 Mar 2013 10:52:37 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 Network Configuration in CentOS & Red Hat https://tecadmin.net/network-configuration-in-centos-redhat/ https://tecadmin.net/network-configuration-in-centos-redhat/#comments Sat, 02 Mar 2013 10:52:37 +0000 https://tecadmin.net/?p=363 Linux provides a number of tools for network configuration. Most important network settings for you Linux machine to access over network are IP configuration Device activation DNS configuration Default gateway 1. Default Network Configuration Files: Default linux interfaces configuration file exists in /etc/sysconfig/network-scripts/ named ifcfg-ethX ( ‘X’ is replace with number 0,1 or 2 etc [...]

The post Network Configuration in CentOS & Red Hat appeared first on TecAdmin.

]]>
Linux provides a number of tools for network configuration. Most important network settings for you Linux machine to access over network are

  • IP configuration
  • Device activation
  • DNS configuration
  • Default gateway

1. Default Network Configuration Files:

  • Default linux interfaces configuration file exists in /etc/sysconfig/network-scripts/ named ifcfg-ethX ( ‘X’ is replace with number 0,1 or 2 etc ).
  • /etc/sysconfig/network : is global configuration file
     NETWORKING = yes
     HOSTNAME = server1.tecadmin.net
     GATEWAY = 192.168.10.1
    
  • /etc/sysconfig/network-script/ifcfg-ethX : is Ethernet configuration file so assign ip address, netmask on interface.
  • /etc/resolv.conf : DNS servers ip addresses are specified in this file.
  • /etc/hosts : Is used for locally resolve a hostname with ip.

2. Device Configuration:

There are two ways to configure network device to get ip address. 1- In dynamic configuration system gets ip address and other network details from dhcp server where in static configuration we set the fixed ip address and network details in interfaces configuration files. Below is the example file of network interfaces.

Dynamic Configuration:

DEVICE = ethX
HWADDR = 00:33:5A:9B:74:99
BOOTPROTO = dhcp
ONBOOT = yes
TYPE = Ethernet

Static Configuration:

DEVICE = ethX
HWADDR = 00:33:5A:9B:74:99
BOOTPROTO = static
IPADDR = 192.168.10.100
NETMASK = 255.255.255.0
GATEWAY = 192.168.10.1
ONBOOT = yes
TYPE = Ethernet
USRCTL = no

Details of configuration parameters:

  • DEVICE: Ethernet device name
  • HWADDR: Hardware address or MAC address
  • BOOTPROTO: dhcp or static
  • ONBOOT: yes/no , it tells that interface will automatically up or not on boot.
  • Type: Type of interface.
  • USRCTL: yes/no , it tells that a non root user can bring this device up or down.

If you do not want to edit files directly, you can use `setup` command to configure network interfaces

The post Network Configuration in CentOS & Red Hat appeared first on TecAdmin.

]]>
https://tecadmin.net/network-configuration-in-centos-redhat/feed/ 1