ragnarokkrr
5/2/2016 - 10:49 PM

How do i Configure Static IP Address Internet Protocol (IPv4) http://www.tecmint.com/ip-command-examples/

How do i Configure Static IP Address Internet Protocol (IPv4)

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

# For RHEL/CentOS/Fedora
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
DEVICE="eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.50.2
NAME="System eth0"
HWADDR=00:0C:29:28:FD:4C
GATEWAY=192.168.50.1

# For Ubuntu/Debian/Linux Mint

$ vi /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.1


$ sudo /etc/init.d/networking restart
$ sudo ip route add default via 192.168.50.100
# For RHEL/CentOS/Fedora

# vi /etc/sysconfig/network-scripts/route-eth0
10.10.20.0/24 via 192.168.50.100 dev eth0

# For Ubuntu/Debian/Linux Mint
# $ sudo vi /etc/network/interfaces

$ sudo vi /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.100
#########{Static Route}###########
up ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0


$ sudo /etc/init.d/network restart
$ sudo ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
$ sudo ip addr del 192.168.50.5/24 dev eth1