ifconfig shall be replaced by “ip” but many users are very used to ifconfig 🙂

is not anymore installed per default, and needs to be installed manually.

the problem: ifconfig might not be sufficient anymore, because it might for example, not show all ip addresses given to a computer

thus it is deprecated (and not recommended to be used anymore… but once the user is used to a set of tools it is hard to change that)

hence it is (unfortunately) not shipped anymore per default on many GNU Linux Distributions, here is how to install it/get it back:

GNU Linux Debian Ubuntu Fedora CentOS RedHat – ifconfig not found – how to install net-tools

Set a fixed ip, activate network card and add default gateway

this will:

1. set a fixed ip

2. define a default gateway

3. define the default gateway as dns

# set a TERMPORARY (!) fixed ip for eth0 and activate the device
ifconfig eth0 192.168.1.123 netmask 255.255.255.0 up

# the problem with the approach above is
# that the (GNOME)network-manager system-tools
# will reverse that setting every x seconds
# so here is a loop that REapplies the settings every 8 seconds
SUBNET=8;while true; do ifconfig enp2s0:0 192.168.$SUBNET.123 up; ifconfig; ping -c 10 192.168.$SUBNET.1; sleep 3; clear; done

# SUBNET=8 = asign ip: 192.168.8.123 and ping 192.168.8.1

# set default gateway
route add default gw 192.168.1.1
# how PERMANENTLY change dns nameserver
# edit the file
vim /etc/resolv.conf
# and change (ip of nameserver the user wants to use)
nameserver 192.168.1.1

with dns you do not have to up down the interface… it works directly after you have modified the file.

https://dwaves.de/2017/05/09/bind-and-dns-the-phonebook-of-the-internet-berkeley-internet-name-domain-how-to-benchmark-dns-servers-find-fastest/

manpages:

2008: ifconfig.2008.man.txt

2007: ifconfig.man.txt

Links:

http://www.tecmint.com/ifconfig-command-examples/

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin