Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
In this article, we will explore the concept of IP addressing and its importance in the Linux environment. We will discuss how IP addresses are used to identify devices on a network, allocate IP addresses in Linux, and configure network interfaces. Additionally, we will provide practical examples and commands specific to the Linux environment.
Examples:
Allocating IP Addresses in Linux:
cd /etc/sysconfig/network-scripts/
vim ifcfg-eth0
BOOTPROTO
value to static
and add the desired IP address, subnet mask, default gateway, and DNS servers:
BOOTPROTO=static
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
systemctl restart network
Configuring DHCP in Linux:
cd /etc/sysconfig/network-scripts/
vim ifcfg-eth0
BOOTPROTO
value to dhcp
:
BOOTPROTO=dhcp
systemctl restart network