30 May 2014

redhat-centos-fedora : manually set ip address


3 ways to manually set or change ip address via terminal


1) via command line:


---------------------------
ifconfig eth0 10.0.1.27 netmask 255.255.255.0 up
echo nameserver 10.0.1.1 > /etc/resolv.conf
route add default gw 10.0.1.1

----------------------------




2) via configuration file (using DHCP):

vi /etc/syscontrol/networking/ifeth0-cfg


-------------------
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

--------------------


once done, you need to restart the newtork service:
$ service networking restart



3) via configuration file (manual configuration w/o DHCP):

vi /etc/syscontrol/networking/ifeth0-cfg

--------------------
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes            <----- boot="" check="" enable="" eth="" on="" span="" this="" to="">
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.27
USERCTL=no
GATEWAY=10.0.1.1
HWADDR=??:??: ...

--------------------


once done, you need to restart the newtork service:

service networking restart



4) via "setup" menu ... simply run command -->  setup in a terminal ...

this is the most easy way but, if you installed the OS using the "minimal" distribution,
the "setup" suite may not be available.
 

There are the instructions to install it:

yum install setuptool.x86_64 
 -- or --
yum install setuptool.i686

yum install system-config-network-tui system-config-firewall-tui system-config-firewall-base system-config-date system-config-services system-config-users



No comments: