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
3
votes
2 answers

add and remove IP addresses to an interface using ioctl or netlink

Is there anyway to add and remove IP addresses from an interface (like loopback) in C? I found ioctl and a few documents explaining how to do that (e.g. this link), however they are all for setting addresses not adding and removing? Following the…
Amir
  • 5,996
  • 13
  • 48
  • 61
3
votes
4 answers

Extracting an IP address to a variable using Expect script

Hi I am new to Expect scripting, and I have been trying to fetch an IP address into a variable using following : set timeout -1 spawn $env(SHELL) match_max 100000 send "ifconfig | grep -A 1 'eth1' | tail -1\r " expect -re "inet addr:.* " {send "ping…
Mmudalagiri
  • 31
  • 1
  • 2
3
votes
1 answer

Reading the output of a terminal command in java with BufferedReader

Noobie at java just starting, would appreciate any help. So my code is this and for some reason I cant get the output to work..I ve been sitting at this for hours.. package askisi1; import java.net.*; import java.util.*; import java.lang.*; import…
Stelios Savva
  • 812
  • 1
  • 10
  • 30
3
votes
5 answers

SIP and EC2 elastic IPs

I'm trying to make a custom SIP software work on an EC2 instance. My software at the moment doesn't have NAT handling capabilities, and I was wondering If I could get it to work transparently with the public (elastic) IP associated to the EC2…
Guido
  • 341
  • 5
  • 18
2
votes
2 answers

change ip address of server using PHP

i need to be able to change the IP address of a server using PHP. i'm trying to use ifconfig eth0 down as the www-data user to make sure it will work. so far, i've gotten rid of a permissions issue on /var/run/network/ifstate file, but now i get a…
moonlightcheese
  • 10,664
  • 9
  • 49
  • 75
2
votes
3 answers

translate pcregrep into Perl one-liner

I need to find all active network interfaces on new macOS. That means the following one-liner with pcregrep will not work: ifconfig | pcregrep -M -o '^[^\t:]+(?=:([^\n]|\n\t)*status: active)' because pcregrep is no default install on macOS. I tried…
2
votes
0 answers

Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmardown::pandoc_available)

I am working in RStudio Cloud and am unable to knit markdowns, with this resulting message: Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available). Execution halted To fix this, I…
IceJ14
  • 21
  • 2
2
votes
3 answers

awk prints $2 to what I expect, but when I compare $2's value to same it returns false

When I am giving the following command - ip -br -c addr show | awk '{print $2}' It returns something like this output - UNKNOWN UP DOWN UP UP UP UP but when I want to only print the ones which are UP and I say - ip -br -c addr show | awk '$2 ==…
inquisitive
  • 3,738
  • 6
  • 30
  • 56
2
votes
1 answer

can0 listen can-bus but no data appears

I'm trying to read a CAN-BUS on a vehicle with a raspberry (CAN is connected to DB9 connector on the raspberry). The vehicle provides energy to the raspberry also. Here's my stack: Protocol CAN "ISO 15765 CAN" by Bosch CAN-Bus Board PiCAN3 machine :…
wajisan
  • 94
  • 6
2
votes
1 answer

Network is unreachable after reboot

This is the output of ifconfig on my Yocto embedded Linux board (I am using eth0.2 interface): eth0 Link encap:Ethernet HWaddr f8:dc:7a:3b:e9:f8 inet6 addr: fe80::fadc:7aff:fe3b:e9f8/64 Scope:Link inet6 addr:…
godo
  • 195
  • 1
  • 11
2
votes
2 answers

How to modify input from ifconfig in awk

Edit: Sample output of ifconfig enp2s0f1: flags=4099 mtu 1500 ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX…
kamil_debski
  • 131
  • 8
2
votes
4 answers

Awk as an ifconfig filter

I'm new to the whole awk tool, it's seems really complicated to me. Sample ifconfig output: enp2s0f1: flags=4099 mtu 1500 ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) …
kamil_debski
  • 131
  • 8
2
votes
2 answers

How to enable or disable Ethernet programmatically?

I want to enable and disable Ethernet in android programatically. I have used following commands which are working on terminal but not on Java code. ifconfig eth0 down ifconfig eth0 up and my code public String executeCommand() { StringBuffer…
D.J
  • 1,439
  • 1
  • 12
  • 23
2
votes
4 answers

Regex grep external IP brings back internal IP as well - why?

I have this grep operation here that gives you the external IP from the output of ifconfig: ipa=$(ifconfig | grep -Po "inet addr:\K[^\s]+" | grep -v "^127") I desire to use only one grep, so I tried the following, which was partly…
Osi
  • 1
  • 3
  • 9
  • 30
2
votes
3 answers

VMWare Fusion: vmnet1 and vmnet8 not showing up after install Fusion 8.x or 10.x on Mac Sierra

After installing Fusion 8.x and 10.x, I cannot find the vmnet1 and vmnet8 at all. When I do sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli -c This is what I got: Configuring Bridged network vmnet0 Configuring hostonly network…
HP.
  • 19,226
  • 53
  • 154
  • 253