Monday, March 3, 2014

Network Configuration in Redhat

Today we will learn about Network Configuration.
After do installation we need to configure the network so we can connect our server to other server.

First of all before we do the configuration for network, we must know the folder to edit the configuration.
The folder was in /etc/sysconfig/network-scripts/
By default, computer had 1 LAN Card. In Linux, the named for LAN Card begin from eth0, eth1, and etc.

Below is the example configuration file ifcfg-eth0

DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0

for column DEVICE, is set with eth that we want to use.
for column ONBOOT, is set with value yes or no. this configuration was used for first boot.
  if yes when computer was reboot, linux system will use this configuration automaticaly.
  if no when computer was reboot, linux system will not used this configuration automaticaly.
for column IPADDR, we can set using IP Address that we want to use.
for column NETMASK, is set with subnetmask that we want to use.
for column BOOTPROTO is set with static or dhcp. 
  if we want to use ip dhcp, we can write dhcp
  if we want to use static, we can write static

after we save the configuration, we can restart the service with command
    /etc/init.d/network restart 
or
    service network restart 


To check the configuration that we already set. 
we can use command 


[elvin@TestBed ~]$ /sbin/ifconfig

eth0      Link encap:Ethernet  HWaddr A4:BA:DB:37:F1:04
          inet addr:192.168.88.1  Bcast:192.168.88.255  Mask:255.255.255.192
          inet6 addr: fe80::9e8e:99ff:fe2a:c17c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1488  Metric:1
          RX packets:5294873 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1082194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:384079557 (366.2 MiB)  TX bytes:82553598 (78.7 MiB)
          Interrupt:154 Memory:f8000000-f8012800  

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:106829126 errors:0 dropped:0 overruns:0 frame:0
          TX packets:106829126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 

          RX bytes:673185560 (641.9 MiB)  TX bytes:673185560 (641.9 MiB)

0 comments:

Post a Comment