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



29 May 2014

Linux & usb

Just a quick guite to mount usb drives via command line:

use fdisk to list all the drives your OS can see:
then simply mount the one you need.

$ sudo fdisk -l
$ sudo mount /dev/sdb1 /mnt/usb


in case you get the error: "special device does not exist"
it is most probably due to an error on the usb device, try formatting it may solve.


Tip: to format a usb drive, enter the followint command

$ mkfs.vfat -n "NEW_DRIVE_NAME" -I /dev/sdx1

(*) replace /dev/sdx1 with the device name of your pendrive (list all the drives using fdisk -l )