What Program Can You Use to Manually Bring Up a Network Interface in Linux?

ifconfig in short "interface configuration" utility for system/network administration in Unix/Linux operating systems to configure, manage and query network interface parameters via control-line interface or in a organization configuration scripts.

[ You might also like: 22 Linux Networking Commands for Sysadmin ]

The "ifconfig" command is used for displaying current network configuration information, setting up an ip address, netmask, or circulate address to a network interface, creating an alias for the network interface, setting upward hardware address, and enable or disable network interfaces.

Ifconfig Command Examples
15 Useful ifconfig Commands

This commodity covers "xv Useful "ifconfig" Commands" with their practical examples, which might be very helpful to you in managing and configuring network interfaces in Linux systems.

Update: The networking command ifconfig is deprecated and replaced by the ip command (Learn x Examples of IP Command) in most Linux distributions.

[ You might too like: ifconfig vs ip: What's Departure and Comparing Network Configuration ]

one. View All Network Interface Settings

The "ifconfig" command with no arguments will display all the active interfaces details. The ifconfig command is as well used to bank check the assigned IP accost of a server.

[[email protected] ~]# ifconfig  eth0      Link encap:Ethernet  HWaddr 00:0B:CD:1C:xviii:5A           inet addr:172.16.25.126  Bcast:172.16.25.63  Mask:255.255.255.224           inet6 addr: fe80::20b:cdff:fe1c:185a/64 Scope:Link           Upwards BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:2341604 errors:0 dropped:0 overruns:0 frame:0           TX packets:2217673 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:yard           RX bytes:293460932 (279.eight MiB)  TX bytes:1042006549 (993.7 MiB)           Interrupt:185 Memory:f7fe0000-f7ff0000  lo        Link encap:Local Loopback           inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:5019066 errors:0 dropped:0 overruns:0 frame:0           TX packets:5019066 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:2174522634 (2.0 GiB)  TX bytes:2174522634 (2.0 GiB)  tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00           inet addr:x.i.1.1  P-t-P:ten.1.1.ii  Mask:255.255.255.255           Upwards POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:100           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

2. Display Information of All Network Interfaces

The following ifconfig control with the -a argument will brandish information of all active or inactive network interfaces on the server. It displays the results for eth0, lo, sit0 and tun0.

[[electronic mail protected] ~]# ifconfig -a  eth0      Link encap:Ethernet  HWaddr 00:0B:CD:1C:18:5A           inet addr:172.xvi.25.126  Bcast:172.xvi.25.63  Mask:255.255.255.224           inet6 addr: fe80::20b:cdff:fe1c:185a/64 Scope:Link           UP Broadcast RUNNING MULTICAST  MTU:1500  Metric:one           RX packets:2344927 errors:0 dropped:0 overruns:0 frame:0           TX packets:2220777 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:293839516 (280.2 MiB)  TX bytes:1043722206 (995.3 MiB)           Interrupt:185 Retentiveness:f7fe0000-f7ff0000  lo        Link encap:Local Loopback           inet addr:127.0.0.ane  Mask:255.0.0.0           inet6 addr: ::1/128 Telescopic:Host           Upward LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:5022927 errors:0 dropped:0 overruns:0 frame:0           TX packets:5022927 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:2175739488 (2.0 GiB)  TX bytes:2175739488 (2.0 GiB)  sit0      Link encap:IPv6-in-IPv4           NOARP  MTU:1480  Metric:one           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)  tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00           inet addr:10.1.1.i  P-t-P:10.1.1.ii  Mask:255.255.255.255           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:i           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:100           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

three. View Network Settings of Specific Interface

Using interface name (eth0) equally an argument with the "ifconfig" command volition display details of the specific network interface.

[[email protected] ~]# ifconfig eth0  eth0      Link encap:Ethernet  HWaddr 00:0B:CD:1C:18:5A           inet addr:172.16.25.126  Bcast:172.16.25.63  Mask:255.255.255.224           inet6 addr: fe80::20b:cdff:fe1c:185a/64 Scope:Link           UP Circulate RUNNING MULTICAST  MTU:1500  Metric:i           RX packets:2345583 errors:0 dropped:0 overruns:0 frame:0           TX packets:2221421 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:thousand           RX bytes:293912265 (280.2 MiB)  TX bytes:1044100408 (995.seven MiB)           Interrupt:185 Retention:f7fe0000-f7ff0000

4. How to Enable a Network Interface

The "upwardly" or "ifup" flag with interface proper name (eth0) activates a network interface if information technology is not inactive land and assuasive to ship and receive information. For example, "ifconfig eth0 upwards" or "ifup eth0" will activate the eth0 interface.

[[email protected] ~]# ifconfig eth0 upward OR [[email protected] ~]# ifup eth0

5. How to Disable a Network Interface

The "down" or "ifdown" flag with interface name (eth0) deactivates the specified network interface. For instance, the "ifconfig eth0 downward" or "ifdown eth0" control deactivates the eth0 interface if it is in an inactive country.

[[email protected] ~]# ifconfig eth0 down OR [[email protected] ~]# ifdown eth0

6. How to Assign an IP Address to Network Interface

To assign an IP address to a specific interface, use the following control with an interface proper name (eth0) and ip address that you desire to set. For example, "ifconfig eth0 172.16.25.125" will set the IP accost to interface eth0.

[[email protected] ~]# ifconfig eth0 172.16.25.125

[ Y'all might too like: How to Configure IP Network with 'nmtui' Tool ]

7. How to Assign a Netmask to Network Interface

Using the "ifconfig" control with the "netmask" statement and interface name as (eth0) allows you to define a netmask to a given interface. For instance, "ifconfig eth0 netmask 255.255.255.224" volition set the network mask to a given interface eth0.

[[e-mail protected] ~]# ifconfig eth0 netmask 255.255.255.224

eight. How to Assign a Broadcast to Network Interface

Using the "broadcast" argument with an interface proper name volition set the broadcast address for the given interface. For example, the "ifconfig eth0 broadcast 172.16.25.63" command sets the broadcast address to an interface eth0.

[[email protected] ~]# ifconfig eth0 broadcast 172.16.25.63

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

To assign an IP address, Netmask accost, and Broadcast address all at once using the "ifconfig" command with all arguments as given below.

[[electronic mail protected] ~]# ifconfig eth0 172.xvi.25.125 netmask 255.255.255.224 broadcast 172.16.25.63

10. How to Modify MTU for a Network Interface

The "mtu" statement 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 is able to handle a maximum number of octets to an interface in ane single transaction.

For example, "ifconfig eth0 mtu m" will set the maximum manual unit to a given set (i.e. 1000). Non all network interfaces back up MTU settings.

[[e-mail protected] ~]# ifconfig eth0 mtu 1000

11. How to Enable Promiscuous Mode

What happens in normal style, when a parcel is received by a network card, it verifies that it belongs to itself. If not, it drops the parcel normally, but in the promiscuous fashion is used to accept all the packets that menstruum through the network menu.

Today's network tools apply the promiscuous style to capture and analyze the packets that catamenia through the network interface. To set the promiscuous mode, use the following control.

[[electronic mail protected] ~]# ifconfig eth0 promisc

12. How to Disable Promiscuous Fashion

To disable promiscuous mode, apply the "-promisc" switch that drops back the network interface in normal mode.

[[email protected] ~]# ifconfig eth0 -promisc

thirteen. How to Add New Alias to Network Interface

The ifconfig utility allows you to configure additional network interfaces using the allonym feature. To add the alias network interface of eth0, use the following control. Please note that the alias network accost is in the same subnet mask. For example, if your eth0 network ip address is 172.16.25.125, then the alias ip accost must be 172.sixteen.25.127.

[[email protected] ~]# ifconfig eth0:0 172.16.25.127

Next, verify the newly created allonym network interface address, by using the "ifconfig eth0:0" command.

[[email protected] ~]# ifconfig eth0:0  eth0:0    Link encap:Ethernet  HWaddr 00:01:6C:99:14:68           inet addr:172.sixteen.25.123  Bcast:172.16.25.63  Mask:255.255.255.240           UP Broadcast RUNNING MULTICAST  MTU:1500  Metric:1           Interrupt:17

fourteen. How to Remove Allonym to Network Interface

If you no longer required an alias network interface or yous incorrectly configured information technology, you tin can remove it by using the following command.

[[email protected] ~]# ifconfig eth0:0 downwards

15. How to Change the MAC address of Network Interface

To modify the MAC (Media Access Command) address of an eth0 network interface, use the post-obit command with the argument "hw ether". For example, see below.

[[electronic mail protected] ~]# ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

These are the near useful commands for configuring network interfaces in Linux, for more information and usage of the ifconfig command use the manpages like "homo ifconfig" at the concluding. Check out another networking utilities below.

Other Networking Utilities

  • nmcli – a command-line customer that is used to command NetworkManager and report network information.
  • Tcmpdump – is a control-line packet capture and analyzer tool for monitoring network traffic.
  • Netstat – is an open-source control-line network monitoring tool that monitors incoming and outgoing network packets traffic.
  • ss (socket statistics) – a tool that prints network socket-related information on a Linux organization.
  • Wireshark – is an open-source network protocol analyzer that is used to troubleshoot network-related issues.
  • Munin – is a web-based network and system monitoring application that is used to display results in graphs using rrdtool.
  • Cacti – is a consummate web-based monitoring and graphing application for network monitoring.

To get more information and options for whatever of the above tools, see the man pages by entering "man toolname" at the control prompt. For example, to go the information for the "netstat" tool, employ the command "human being netstat".

nelsonyousba.blogspot.com

Source: https://www.tecmint.com/ifconfig-command-examples/

0 Response to "What Program Can You Use to Manually Bring Up a Network Interface in Linux?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel