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 (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..

224 questions
437
votes
31 answers

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1 The solution should work at least for Linux (Debian and RedHat) and OS X 10.7+ I am aware that ifconfig is available…
sorin
  • 161,544
  • 178
  • 535
  • 806
137
votes
5 answers

How to get default gateway in Mac OSX

I need to retrieve the default gateway on a Mac machine. I know that in Linux route -n will give an output from which I can easily retrieve this information. However this is not working in Mac OSX(Snow Leopard). I also tried netstat -nr | grep…
SherinThomas
  • 1,881
  • 4
  • 16
  • 20
101
votes
10 answers

How to install "ifconfig" command in my ubuntu docker image?

I've just installed ubuntu docker image, when I execute "ifconfig" it says there's no such command, I tried apt-get install by there's no package named "ifconfig"(I can install some other images). So how to do this? Thanks.
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
62
votes
2 answers

How do I delete virtual interface in Linux?

ip link shows this: [root@0-25-90-68-79-4a log]# ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: mtu 1500 qdisc…
vikas
  • 901
  • 3
  • 10
  • 13
55
votes
2 answers

ifconfig and interfaces

just a question for my understanding. on my mac when I use ifconfig command on my mac I get the following interfaces: en0 en1 lo0 fw0 vment0 vment1 I don't understand why there are so many. I understand that eth0 would be for LAN connections, and…
lollercoaster
  • 15,969
  • 35
  • 115
  • 173
48
votes
4 answers

What are en0, en1, p2p, and so on, that are displayed after executing ifconfig?

When I type ifconfig on my Mac terminal, several information is printed. But I can't understand what they are. Can anyone briefly tell me what they are? What are lo0, gif0, en0, and so on? Here is the results of my terminal. Last login: Wed Apr 29…
KimCrab
  • 2,231
  • 4
  • 15
  • 20
42
votes
6 answers

Find out which network interface belongs to docker container

Docker creates these virtual ethernet interfaces veth[UNIQUE ID] listed in ifconfig. How can I find out which interface belongs to a specific docker container? I want to listen to the tcp traffic.
Mahoni
  • 7,088
  • 17
  • 58
  • 115
34
votes
7 answers

no network in Android x86 on VirtualBox 4.1.2

My issue is nearly identical to this question. I tried those solution and none worked. But I am using a different Android x86 image. I'm using the ICS (4.0-RC1) asus_laptop image. (I tried a different image previously and couldn't get it to…
MountainX
  • 6,217
  • 8
  • 52
  • 83
20
votes
1 answer

Why is Wi-Fi called en0, like ethernet, on a Mac OS X?

Linux has been my main system for years now. In Linux, ethernet hardware devices have names like eth0 or enp1s0 (the latter I've only seen on Arch Linux). The wireless card has always had names like wlan0 or wlp2s0 (again the latter on Arch). On my…
Hugo
  • 2,186
  • 8
  • 28
  • 44
19
votes
20 answers

Parse ifconfig to get only my IP address using Bash

I want to edit the bashrc file to have a simple function called "myip" to run. As you might guess, the function myip prints only my internal IP address of my machine. The far as I got working, this is the script: ifconfig en1 | awk '{ print $2}' |…
Fernando Retimo
  • 1,003
  • 3
  • 13
  • 25
17
votes
3 answers

Setting variable in bash -c

I try to set variable which get interface ip-address from ifconfig and read it later. But when I execute a echo command, variable still empty. Please look at my code: /usr/bin/bash -c "HOST_IPS=$(/usr/bin/ifconfig | /usr/bin/awk 'BEGIN {cnt=0}…
d0xin
  • 173
  • 1
  • 4
15
votes
5 answers

Do MTU modifications impact both directions?

ifconfig 1.2.3.4 mtu 1492 This will set MTU to 1492 for incoming, outgoing packets or both? I think it is only for incoming
cateof
  • 6,608
  • 25
  • 79
  • 153
15
votes
8 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/config returns commmand not found. This is echo…
RobSeg
  • 985
  • 4
  • 14
  • 37
12
votes
1 answer

Waiting for network link to be up before continuing in bash

Is there a way to check for successful network interface link for multiple interfaces in a bash script before continuing? Something like: eth0 eth1 eth2 eth3 network interfaces are brought up Wait for link detection on all 4 interfaces Proceed
user1527227
  • 2,068
  • 5
  • 25
  • 36
12
votes
2 answers

Set static ip if not obtained from DHCP (script)

I work on embedded device with linux on it. I want to use DHCP client first, but if there will be no answer from DHCP Server I want to set static-default IP. I suppose it shouldn't be complicated, but I haven't found strict answer. I'm thinking…
Bartlomiej Grzeskowiak
  • 1,009
  • 5
  • 16
  • 35
1
2 3
14 15