3.6. Configuring IP Networking with ip Commands
ipcommand, but but changes are not persistent across reboots; when you reboot, you will lose any changes.
man ip(8)page. The package name in Red Hat Enterprise Linux 7 is iproute. If necessary, you can check that the ip utility is installed by checking its version number as follows:
ip -Vip utility, iproute2-ss130716
ip link set ifname down
ip link set ifnamecommand sets a network interface in
IFF_UPstate and enables it from the kernel's scope. This is different from the
ifup ifnamecommand for initscripts or NetworkManager's activation state of a device. In fact, NetworkManager always sets an interface up even if it is currently disconnected. Disconnecting the device through the nmcli tool, does not remove the
IFF_UPflag. In this way, NetworkManager gets notifications about the carrier state.
ifconfigutility because the net-tools package (which provides
ifconfig) does not support InfiniBand addresses.
ip helpcommand. For example:
ip link helpand
ip addr help.
ifcfgfiles) or add the commands to a script.
IPaddresses to an interface with the following form:
ip addr [ add | del ] address dev ifname
Assigning a Static Address Using ip Commands
IPaddress to an interface:
~]#Further examples and command options can be found in the
ip address add 10.0.0.3/24 dev eth0You can view the address assignment of a specific device: ~]#
ip addr show dev eth02: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether f0:de:f1:7b:6e:5f brd ff:ff:ff:ff:ff:ff inet 10.0.0.3/24 brd 10.0.0.255 scope global global eth0 valid_lft 58682sec preferred_lft 58682sec inet6 fe80::f2de:f1ff:fe7b:6e5f/64 scope link valid_lft forever preferred_lft forever
Configuring Multiple Addresses Using ip Commands
ip address add 192.168.2.223/24 dev eth1~]#
ip address add 192.168.4.223/24 dev eth1~]#
ip addr3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:fb:77:9e brd ff:ff:ff:ff:ff:ff inet 192.168.2.223/24 scope global eth1 inet 192.168.4.223/24 scope global eth1