Questions tagged [ifconfig]

ifconfig (short for interface configuration) is a system administration utility in Unix-like operating systems to configure, control, and query TCP/IP network interface parameters from a command line interface (CLI) or in system configuration scripts. Ifconfig originally appeared in 4.2BSD as part of the BSD TCP/IP suite.

You can use the ifconfig command to assign an address to a network interface and to configure or display the current network interface configuration information.

Read more about ifconfig at Wikipedia

230 questions
200
votes
3 answers

ifconfig command not found

I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) .Running ifconfig returns command not found. Also running sudo /sbin/ifconfig returns commmand not found. I am root. The output of echo $PATH is as below.…
RobSeg
  • 2,440
  • 2
  • 13
  • 13
39
votes
2 answers

ip vs ifconfig commands pros and cons

At some point, in some teaching material (from Linux Foundation) on Linux that I came across, the following is mentioned: ip command is more versatile and more efficient than ifconfig because it uses netlink sockets rather than ioctl system…
pkaramol
  • 2,587
  • 4
  • 36
  • 71
33
votes
6 answers

How to view your computer's MAC address using 'ifconfig'?

After substantial research I still haven't found an answer to this query, how can I modify the command 'ifconfig' to show my computer's MAC address?
Tom Scott
  • 445
  • 1
  • 5
  • 7
28
votes
2 answers

How to understand (the output of) ifconfig or ip addr show

The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through the "Ifconfig Command - Explained in Detail" tutorial page, which gives a great rundown on…
Ari Sweedler
  • 743
  • 1
  • 6
  • 12
22
votes
4 answers

How to set the Default gateway

I'm trying to configure the network interface on embedded linux using ifconfig: ifconfig eth0 192.168.0.101 netmask 255.255.255.0 but I don't know how to add the default gateway as an ifconfig parameter, Any Ideas?
Abdessamad Doughri
  • 331
  • 1
  • 2
  • 5
18
votes
8 answers

Can I prevent a default route being added when bringing up an interface?

I have a system with two NICs on it. This machine, and a few accompanying devices will be moved and attached to different LANs or sometimes it'll be using dial-up. eth0: - 10.x.x.x address space - no internet gateway - only a few…
Tango
  • 353
  • 1
  • 2
  • 8
14
votes
2 answers

What's the difference between "errors:" "dropped:" "overruns:" and "frame:" fields in ifconfig RX packets output?

Can someone please elaborate on the difference between the various RX packets fields in ifconfig output? For example, let's say I run ifconfig and see the following: eth0 Link encap:Ethernet HWaddr AA:BB:CC:DD:EE:FF inet…
Mike B
  • 8,769
  • 24
  • 70
  • 96
11
votes
5 answers

Create an array with all network interfaces in bash

I want to create an array in Bash which to contain all active network interfaces. I have managed to create a for loop printing them but when I try to create the array, it just contains the last lo interface but not the other. This is my code:…
Georgi Stoyanov
  • 790
  • 4
  • 16
  • 41
11
votes
1 answer

What is a generic socket and how does it relate to a network device?

I'm trying to understand how network drivers work under Linux. This Q&A showed that the network device in Linux isn't represented by a device file. It states that network drivers work with sockets. For example, this references how to setup the…
TheMeaningfulEngineer
  • 5,735
  • 15
  • 64
  • 113
10
votes
10 answers

How to display the IP address of the default Interface with Internet connection?

I need to create a script that outputs the internal IP address, that is configured as the default Interface.
Marcello de Sales
  • 263
  • 1
  • 3
  • 8
9
votes
3 answers

How to capture the first IP address from a ifconfig command?

How to capture the first IP address that comes from ifconfig command? ifconfig -a enw178032: flags=4163 mtu 1500 inet 100.14.22.12 netmask 255.255.0.0 broadcast 100.14.255.255 inet6…
yael
  • 12,598
  • 51
  • 169
  • 303
8
votes
1 answer

How can I manually reset RX / TX counters in ifconfig output without impacting data delivery?

CentOS 5.9 I'd like to reset the RX/TX counters in ifconfig output for an interface. My understanding is that these counters get reset during a reboot but I'd like to avoid rebooting. Is there another way I can reset that that is non-intrusive to…
Mike B
  • 8,769
  • 24
  • 70
  • 96
7
votes
1 answer

How can I get the ipv4 address from `ip link` like I used to see with ifconfig?

When I run ip to get the ip address, I'm getting $ ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: wlp3s0:…
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
7
votes
2 answers

Ubuntu 18.04 New Netplan / IP Configuration (pointopoint?)

I have a Root-Server with Proxmox installed. Until now, I always had Ubuntu 16. Now i upgraded a VM to Ubuntu 18 and I need an example for the new netplan configuration. This was my old interfaces file: auto ens18 iface ens18 inet static …
R.Kunz
  • 81
  • 1
  • 1
  • 3
7
votes
3 answers

check if network cable is plugged in given NIC

Server has multiple NICs, only one of which has cable plugged in. How can I test whether given port ethX is plugged in or not ? I found many similar questions, but neither ethtool nor cat /sys/class/net/eth1/carrier works for me. In my case, the…
Martin Vegter
  • 69
  • 66
  • 195
  • 326
1
2 3
15 16