0% found this document useful (0 votes)
5 views

Linux Notes

The document provides instructions for configuring an IP address in Linux using three methods: the 'ip' command, network configuration files, and Network Manager. It includes specific commands and file paths for different Linux distributions such as Ubuntu, Debian, RHEL, CentOS, and Fedora. The document also outlines the necessary configurations for static IP addresses, including gateway and DNS settings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Linux Notes

The document provides instructions for configuring an IP address in Linux using three methods: the 'ip' command, network configuration files, and Network Manager. It includes specific commands and file paths for different Linux distributions such as Ubuntu, Debian, RHEL, CentOS, and Fedora. The document also outlines the necessary configurations for static IP addresses, including gateway and DNS settings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

to config IP address in linux:

=============================
sudo -s
enter root password

1. using ip command:
ip addr add 100.1.1.1/24 dev ens3
ip link set dev ens3 up

ip a
ifconfig

2.using network configuration file:


nano or vi /etc/network/interfaces (ubuntu/debian)
nano or vi /etc/sysconfig/network-scripts/ifcfg-* (RHEL/CentOS/Fedora)
systemctl restart networking (ubuntu/debian)
systemctl restart network (RHEL/CentOS/Fedora)

ip a
ifconfig

for (ubuntu/debian):
auto ens3
iface ens3 inet static
address 100.1.1.1
netmask 255.255.255.0
gateway 100.1.1.254
dns-nameservers 8.8.8.8 8.8.4.4

for (RHEL/CentOS/Fedora):
Device=ens3
BOOTPROTO=static
IPADDR=10.1.1.1
NETMASK=255.255.255.0
GATEWAY=100.1.1.254
DNS1=8.8.8.8
DNS2=8.8.4.4
ONBOOT=yes

3.using network manager:


nmcli
wired or wireless
manual
address and netmask

ip a
ifconfig

You might also like