IP addr command 4 RHEL/CentOS/Fedora
Static IP Address configuration:
Static IP Address configuration:
[root@centos ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth1" BOOTPROTO=static ONBOOT=yes TYPE="Ethernet" IPADDR=192.168.0.2 NAME="System eth0" HWADDR=00:0C:00:AF:BB:4C GATEWAY=192.168.0.1
How to Assign a IP Address to Specific Interface
ip addr add 192.168.0.2 dev eth1
How to Check an IP Address
ip addr show
How to Remove an IP Address
ip addr del 192.168.0.2/24 dev eth1How to Enable Network Interface
ip link set eth1 upHow to Disable Network Interface
ip link set eth1 downHow do I Check Route Table
ip route showHow do I Add Static Route
ip route add 10.10.10.0/24 via 192.168.0.10 dev eth1How to Remove Static Route
ip route del 10.10.10.0/24How do I Add Persistence Static Routes
vi /etc/sysconfig/network-scripts/route-eth0 10.10.10.0/24 via 192.168.0.10 dev eth1How do I Add Default Gateway
ip route add default via 192.168.0.1