Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » Linux basic commands
  • AADSTS900144
    Fix AADSTS900144: The request body must contain the parameter Network | Monitoring
  • Snapshot VMware vSphere
    How to Create a Snapshot on vSphere Web Client Virtualization
  • HyperV
    Unable to PXE boot a HyperV VM: F12 key does not work anymore Virtualization
  • FTP
    How to install and configure an FTP Server on Windows Server Windows Server
  • Edge
    Install Microsoft Edge Browser on Ubuntu Linux Linux
  • Hyper V VM creation
    How to Create a Windows Server VM on HyperV Windows Server
  • windows update 03
    How to target WSUS clients with the registry keys Windows Server
  • macrestart
    How to Enable or Prevent Reopen Windows when logging back in after Restart or Shutdown on Mac Mac

Linux basic commands

Posted on 02/11/201615/08/2023 Christian By Christian No Comments on Linux basic commands
Linux commands

Before are some Linux basic commands to keep you going.

ifconfig Commands: This is needed to Configure Network Interface in Linux. ifconfig in simply means interface configuration.utility for system/network administration in Unix/Linux operating systems to configure, manage and query network interface parameters via command line interface or in a system configuration scripts.

The “ifconfig” command is used for displaying current network configuration information, setting up an IP address, netmask or broadcast address to a network interface, creating an alias for the network interface, setting up hardware address and enable or disable network interfaces.

1. ifconfig


The “ifconfig” command with no arguments will display all the active interface details. The ifconfig command is also used to check a server’s assigned IP address.

root@pve:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:xx:69:73:bd

2. Display Information of All Network Interfaces
ifconfig command with -a argument displays information of all active or inactive network interfaces on the server.

Sample: root@pve:~# ifconfig -a

3.View Network Settings of Specific Interface


Using the interface name (eth0) as an argument with the “ifconfig” command will display details of specific network interface.
root@pve:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:xx:69:73:xx
inet6 addr: fe80::a00:xxxx:fe69:73bd/64 Scope:Link

4.Enabling an Network Interface


The “up” or “ifup” flag with interface name (eth0) activates a network interface, if it is not in active state and allowing to send and receive information. For example, “ifconfig eth0 up” or “ifup eth0” will activate the eth0 interface.

Example 1: root@pve:~# ifconfig eth0 up
The Sample: root@pve:~#
Command to use: root@pve:~# !both commands can be used to achieve the same result.
root@pve:~#
root@pve:~# ifup eth0

5.Disabling a Network Interface


root@pve:~# ifconfig eth0 down.
The semaphore timeout period has expired.
Proof: root@pve:~# !both commands can be used to achieve the same result to shutdown as well.
root@pve:~#
root@pve:~#ifdown eth0

6. Assigning an IP Address to a Network Interface


Moreover, To assign an IP address to a specific interface, use the following command with an interface name (eth0) and ip address that you want to set.
root@pve:~# ifconfig eth0 172.xx.25.1xx
This will set the IP address to interface eth0

7. Assigning an IP Address to a Netmask to Network Interface


However, Using the “ifconfig” command with “netmask” argument and interface name as (eth0) allows you to define a netmask to a given interface.
For example, “ifconfig eth0 netmask 255.255.xxx.22x” will set the network mask to a given interface eth0.

root@pve:~# ifconfig eth0 netmask 255.255.xxx.22x

8. How to Assign a Broadcast to Network Interface


Nonetheless, Using the “broadcast” argument with an interface name will set the broadcast address for the given interface.
For example, “ifconfig eth0 broadcast 172.xx.25.xx” command sets the broadcast address to an interface eth0.
root@pve:~# ifconfig eth0 broadcast 172.xx.25.xxx

9. How to Assign a IP, Netmask and Broadcast to Network Interface


Moreover To assign an IP address, Netmask address and Broadcast address all at once using “ifconfig” command with all arguments as given below.

root@pve:~# ifconfig eth0 172.xx.25.xx netmask 255.255.xxx.xx broadcast 172.xx.25.xx

10. How to Change MTU for a Network Interface


However, The “mtu” argument sets the maximum transmission unit to an interface.
The MTU allows you to set the limit size of packets that are transmitted on an interface. The MTU able to handle a maximum number of octets to an interface in one single transaction. For example, “ifconfig eth0 MTU 1000” will set the maximum transmission unit to a given set (i.e. 1000). Not all network interfaces support MTU settings.

root@pve:~#ifconfig eth0 mtu 1000

11. How to Enable Promiscuous Mode
Therefore, What happens in normal mode is when a packet is received by a network card,
it verifies that the packet belongs to itself. If not, it drops the packet normally, but in the promiscuous mode, it accepts all the packets that flows through the network card.

However, Most of the today’s network tools uses the promiscuous mode to capture and analyze the packets that flows through the network interface.
To set the promiscuous mode, use the following command.

root@pve:~#ifconfig eth0 promisc


12. How to Disable Promiscuous Mode
To disable promiscuous mode, use the “-promisc” switch that drops back the network interface in normal mode.
root@pve:~#ifconfig eth0 -promisc

13. How to Change the MAC address of Network Interface
To change the MAC (Media Access Control) address of an eth0 network interface, use the following command with the argument “hw ether“.

root@pve:~#ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Linux

Post navigation

Previous Post: Backup image to TFTP server
Next Post: How to enable ssh via ASDM on Cisco ASA

Related Posts

  • How to use Netstat.exe to confirm which Program uses or blocks a port
    How to use Netstat.exe to confirm which Program uses or blocks a port Linux
  • Screenshot 2020 05 14 at 17.46.59
    Linux System Update: Upgrade vs. Dist-upgrade Differences Linux
  • feature image mongo
    How to Install MongoDB on a Linux System Linux
  • FEATURE IMAGE BASE URL 1
    How to solve cannot find a valid base URL for repo: base/7/x86_64 Linux
  • integrate VHR with VBR
    How to deploy and integrate VHR with VBR Backup
  • goland
    How to install Golang on a Linux System Linux

More Related Articles

How to use Netstat.exe to confirm which Program uses or blocks a port How to use Netstat.exe to confirm which Program uses or blocks a port Linux
Screenshot 2020 05 14 at 17.46.59 Linux System Update: Upgrade vs. Dist-upgrade Differences Linux
feature image mongo How to Install MongoDB on a Linux System Linux
FEATURE IMAGE BASE URL 1 How to solve cannot find a valid base URL for repo: base/7/x86_64 Linux
integrate VHR with VBR How to deploy and integrate VHR with VBR Backup
goland How to install Golang on a Linux System Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • AADSTS900144
    Fix AADSTS900144: The request body must contain the parameter Network | Monitoring
  • Snapshot VMware vSphere
    How to Create a Snapshot on vSphere Web Client Virtualization
  • HyperV
    Unable to PXE boot a HyperV VM: F12 key does not work anymore Virtualization
  • FTP
    How to install and configure an FTP Server on Windows Server Windows Server
  • Edge
    Install Microsoft Edge Browser on Ubuntu Linux Linux
  • Hyper V VM creation
    How to Create a Windows Server VM on HyperV Windows Server
  • windows update 03
    How to target WSUS clients with the registry keys Windows Server
  • macrestart
    How to Enable or Prevent Reopen Windows when logging back in after Restart or Shutdown on Mac Mac

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.