Network interfaces may become active or inactive, the routing table may change, and IP addresses may change. Comprehensive Explanation: The ifconfig command is a network management tool that is used to configure and view the status of the network interfaces in Linux operating systems1. With ifconfig, you can assign IP addresses, enable or disable interfaces, manage ARP cache, routes, and more1. Some of the possible consequences of using the ifconfig command are:
Network interfaces may become active or inactive. The ifconfig command can take an interface name as an argument and display the configuration information for that interface. For example, to view the configuration of the eth0 interface, one can run:
ifconfig eth0
The output shows whether the interface is UP or DOWN, meaning active or inactive. The ifconfig command can also activate or deactivate an interface by using the up or down options. For example, to deactivate the eth0 interface, one can run:
sudo ifconfig eth0 down
To activate the eth0 interface, one can run:
sudo ifconfig eth0 up
The routing table may change. The ifconfig command can assign IP addresses, netmask, and broadcast address to a network interface. For example, to assign an IP address of 192.168.1.10, a netmask of 255.255.255.0, and a broadcast address of 192.168.1.255 to the eth0 interface, one can run:
sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
These parameters affect the routing table, which is a list of rules that determine where the packets are sent. The routing table can be viewed by using the route command. For example, to view the routing table, one can run:
route -n
The output shows the destination, gateway, netmask, flags, metric, reference, use, and interface for each route. The ifconfig command can also delete an IP address from an interface, which may remove the corresponding route from the routing table. For example, to delete the IP address of 192.168.1.10 from the eth0 interface, one can run:
sudo ifconfig eth0 0
IP addresses may change. The ifconfig command can assign or delete IP addresses to a network interface, as explained above. The IP address is a unique identifier that allows the network interface to communicate with other devices on the network. The IP address can be viewed by using the ifconfig command without any options or with the interface name only. For example, to view the IP address of the eth0 interface, one can run:
ifconfig eth0
The output shows the inet addr, which is the IP address of the interface. The ifconfig command can also create an alias for the network interface, which is a virtual interface that shares the same physical interface but has a different IP address. For example, to create an alias for the eth0 interface with an IP address of 192.168.1.11, one can run:
sudo ifconfig eth0:0 192.168.1.11
The alias can be viewed by using the ifconfig command with the alias name. For example, to view the configuration of the eth0:0 alias, one can run:
ifconfig eth0:0
The output shows the inet addr, which is the IP address of the alias.
The other options are not correct because:
New name servers may be added to the resolver configuration. The ifconfig command does not affect the resolver configuration, which is a file that contains the names and addresses of the name servers that resolve domain names to IP addresses. The resolver configuration is stored in the /etc/resolv.conf file and can be viewed or edited by using a text editor. For example, to view the resolver configuration, one can run:
cat /etc/resolv.conf
The output shows the nameserver entries, which are the IP addresses of the name servers. The ifconfig command does not add or remove name servers from this file.
The system’s host name may change. The ifconfig command does not affect the host name, which is a name that identifies the system on the network. The host name is stored in the /etc/hostname file and can be viewed or edited by using a text editor. For example, to view the host name, one can run:
cat /etc/hostname
The output shows the host name of the system. The ifconfig command does not change the host name of the system. References:
https://linuxize.com/post/ifconfig-command/
https://www.ibm.com/docs/en/aix/7.2?topic=i-ifconfig-command