Pages

Saturday, June 24, 2017

10 Useful “IP” Commands to Configure Network Interfaces

In this post, we are going to review how we can assign Static IP AddressStatic RouteDefault Gateway etc.  Assigning IP Address on demand using IP command. IFCONFIG command is deprecated and replaced by IP command in Linux. However, IFCONFIG command is still works and available for most of the Linux distributions.
IP Command Examples
10 IP Command Examples
Note: Please take configuration file backup before doing any changes.

How do i Configure Static IP Address Internet Protocol (IPv4)

To configure static IP Address, you need to update or edit network configuration file to assign an Static IP Address to a system. You must be superuser with su (switch user) command from terminal or command prompt.

For RHEL/CentOS/Fedora

Open and edit network configuration file for (eth0 or eth1) using your favorite editor. For example, to assigning IP Address to eth0 interface as follows.
[root@tecmint ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Simple output:
DEVICE="eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.50.2
NAME="System eth0"
HWADDR=00:0C:29:28:FD:4C
GATEWAY=192.168.50.1

For Ubuntu/Debian/Linux Mint

Assign Static IP Address to eth0 interface editing configuration file /etc/network/interfaces to make permanent changes as shown below.
auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.1
Next, restart network services after entering all the details using the following command.


      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n7SgD

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment