Linux - Network

1 - About

Network management on Linux

3 - Management

3.1 - Configuration

3.1.1 - Hostname

3.1.2 - DNS

3.1.3 - DHCP


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

Enter this parameter:


DHCP_HOSTNAME=yourhostname

See also Linux - ifconfig (Interface Configuration)

Dhcp Check:


sudo dhclient eth0

3.1.4 - Host File

3.1.5 - Ethernet Interface

Set up the ethernet network adapter interface (local connection)

The name of the interface is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.


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


DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.10 # A free ip number
NETMASK=255.255.255.0
NETWORK=192.168.0.0
GATEWAY=192.168.0.1
ONBOOT=yes
NM_CONTROLLED=no

You can also config it with ifconfig.

Example:


ifconfig eth0 address 192.168.0.10  #IPADDR
ifconfig eth0 netmask 255.255.255.0 # netmask

3.1.6 - Routing Table

See netstat


netstat -rn # for routing table

3.2 - Stop and start the network Service


[[email protected] ~]# service network restart


Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.               [  OK  ]

The below statement will call the following scripts:


/etc/init.d/network stop
/etc/init.d/network start


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap