Sie sind auf Seite 1von 4

RH124-Day02

Written by Razib Shahriar Rubence

Change IP, Gateway, Hostname and DNS Information (We need this changingfor client-server communication in LAB)

- File containing IP, Gateway and DNS Information: /etc/sysconfig/network-scripts/ifcfg-eth0 - File containing Hostname Information: /etc/sysconfig/network

LAB Practice:

01. From Terminal

- Change IP, Gateway, DNS Information

# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.20 NETMASK=255.255.255.0 GATEWAY=192.168.0.254 DNS1=192.168.0.254 -----------------------> introduced in RHEL6

- Change Hostname Information

# vim /etc/sysconfig/network

1/4

RH124-Day02
Written by Razib Shahriar Rubence

NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=station20.example.com

- Restart the network service to make each of the above information effective. Need to reboot machine for hostname change

# service network restart (or # /etc/init.d/network restart)

- Check the changes took effect

# ifconfig (for IP Information) # route -n (for Gateway Information) # hostname (for hostname information) # ping server1.example.com (checking your dns is resolving other computers' hostname) # dig server1.example.com (check the dns records ) 02. Graphical Way:

Open "Network Configuration Window" from System->Administration->Network or by typing following in terminal

# system-config-network

Edit Information from "Devices" GNOME Graphical Desktop and Editing File with gedit: ------------------------------------------------------------------ GNOME is the graphical desktop environment which adds menus, icons,panels provided by the X windows system - It includes integrated applications - gedit, Nautilus File Manager, Graphical Administration Tool

2/4

RH124-Day02
Written by Razib Shahriar Rubence

- gedit for file editing LAB Practice:

- edit file with gedit. /etc/issue (To change the starting message); /etc/grub.conf (Changing the First boot OS in dual/multipel booting machine)

- edit the same file with vi/vim # vim /etc/issue # vim /etc/grub.conf

Change the Default = 0 or 1 to select your starting OS

- Linux File Hierarchy Concepts: * Files and directories are organized into a single-rooted inverted tree structure * Filesystem begins at the root directory, represented by a lone / (forward slash) character * Names are case-sensetive * Paths are delimited by / * .. refers to the parent directory of any particular directory - one level up in the file hierarchy * . refres to the current directory - Some important directories: * Home Directories: /root, /home/username * User Executable (binary file): /bin, /usr/bin, /usr/local/bin (bin = binary) * System Executatble (system binary file): /sbin, /usr/sbin, /usr/local/sbin (sbin = system binary) * Other Mountpoings: /media, /mnt * Configuration: /etc * Temporary: /tmp * Kernels and Bootloader: /boot * Server Data: /var, /srv * System information: /proc, /sys (proc -> process information pseudo-filesystem * Shared Library: /lib, /usr/lib, /usr/local/lib - Absolute Pathnames: * Begin with a forward slash

3/4

RH124-Day02
Written by Razib Shahriar Rubence

* Complete "road map" to file location * can be used anytime you wish to specify a file name - Relative Pathnames: * Do not begin with a slash * Specify location relative to our current workding directory * Can be used as a shorter way to specify a directory or filename Relative pathnames of a specific file /usr/share/doc/HTML/index.html relative to particular directories

Current Directory ---------------------------------------- Relative Path to index.html

/usr/share/doc/HTML ---------------> index.html /usr/share/doc ----------------> HTML/index.html /usr/share ----------------> doc/HTML/index.html / -----------------> usr/share/doc/HTML/index.html /usr/share/doc/HTML/en ------------> ../index.html /usr/share/doc/nautilus-2.1.91 ------------> ../HTML/index.html /etc --------------> ../usr/share/doc/HTML/index.html

4/4

Das könnte Ihnen auch gefallen