The ifconfig command in Linux creates and configures network interfaces and their parameters. This operation is generally done during the system loading process. If no parameters are passed, it displays the settings of the active interfaces.
The ifconfig command is no longer used in distributions, the use of the ip command is preferred.
The ifconfig parameters can be:
Examples:
$ ifconfig eth0 Link Encap:Ethernet HWaddr 00:50:FC: 34:7 E:1E inet addr:200.150.34.188 Bcast:255.255.255.255 Mask:255.255.248.0 inet6 addr: fe80: :250:fcff:fe 34:7 e1e/64 Scope:Link UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37120678 errors:0 dropped:0 overruns:0 frame:0 TX packets:716794 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:3034722143 (2894.1 Mb) TX bytes:87881958 (83.8 Mb) Interrupt:5 Base Address:0x7000 or 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:72610 errors:0 dropped:0 overruns:0 frame:0 TX packets:72610 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7969003 (7.5 Mb) TX bytes:7969003 (7.5 Mb)
To configure the IP, mask, and broadcast of a network card:
$ ifconfig eth0 10.0.0.1 netmask 255.255.0.0 broadcast 10.0.0.255
To lift a network interface:
$ ifconfig eth0 up
To view a particular network interface:
$ ifconfig eth0 eth0 Link Encap:Ethernet HWaddr 00:50:FC: 34:7 E:1E inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.0.0 inet6 addr: fe80: :250:fcff:fe 34:7 e1e/64 Scope:Link UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37120678 errors:0 dropped:0 overruns:0 frame:0 TX packets:716794 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:3034722143 (2894.1 Mb) TX bytes:87881958 (83.8 Mb) Interrupt:5 Base Address:0x7000
The ifconfig command can be used to verify IPv4 and IPv6 network addresses.
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.