Software >> OS >> Unix >> Linux >> How to configure static or dynamic IP

eg. for Redhat 7.2 1. simple way # netconfig 2. manual config for dynamic /etc/sysconfig/network : NETWORKING=yes HOSTNAME=localhost.localdomain /etc/sysconfig/network-scripts/ifcfg-<device> DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes 3. manual config for static /etc/sysconfig/network : NETWORKING=yes HOSTNAME=localhost.localdomain /etc/sysconfig/network-scripts/ifcfg-<device> DEVICE=eth0 BOOTPROTO=static ONBOOT=yes # Start at boot up? NETWORK=192.168.33.0 BROADCAST=192.168.33.255 IPADDR=192.168.33.50 GATEWAY=192.168.33.1 # Default Gateway NETMASK=255.255.255.0 4. script way, edit /etc/rc.d/rc.local and add ifconfig eth0 155.69.254.114 netmask 255.255.255.0 broadcast 155.69.254.255 route add default netmask 0.0.0.0 gw 155.69.254.1 metric 0 dev eth0