(一)設(shè)置IP地址:
1.查看當(dāng)前ip:
# ifconfig
2.配置ip地址:
# cd/etc/sysconfig/network-scripts/
# vi ifcfg-eth0
(ifcfg-eth0文件內(nèi)容:
Device -- 當(dāng)前網(wǎng)卡設(shè)備名稱
hwaddr -- 子網(wǎng)掩碼
type = ethernet --網(wǎng)絡(luò)類型(以太網(wǎng))
uuid = --當(dāng)前系統(tǒng)地址的唯一編號(hào)
onboot = no/yes --啟動(dòng)虛擬機(jī)時(shí)網(wǎng)卡是否需要被啟動(dòng)
hM-controled -- 當(dāng)前此張網(wǎng)卡是否需要被network程序管理
bootproto --網(wǎng)卡是如何捕獲Ip地址的(啟動(dòng)的前提條件:onboot=yes)
=dhcp(自動(dòng)獲取IP地址)
=static(設(shè)置為固定IP地址)
(修改:onboot=yes)
3.重啟網(wǎng)絡(luò)服務(wù):
# service network restart 或
# /etc/init.d/network restart
4.查看修改后IP:
# ifconfig eth0
(二)配置本地yum源:
? 前提條件:
1.查看mnt文件夾是否為空:
# ls cd/mnt/dev/mnt
2.實(shí)現(xiàn)掛載(把/cdrom下的文件掛載到/mnt下)
# mount? /dev/cdrom? /mnt
3.創(chuàng)建自己的本地yum源配置文件:test.repo
? 查看yum源配置路徑下的文件:
# cd/etc/yum.repo.d/
(rhel-source.repo? test.repo)
? 復(fù)制原文件到test.repo文件:
# cp rhel-source.repo test.repo
? 給原文件重命名:
# mv rhel-source.repo rhel-source.repo.bak(bak為備份文件后綴)
? 編輯test.repo文件:
# vi test.repo
? 修改:
baseurl=file:///mnt
enabled=1
gpgcheck=0
? 查看修改后文件:
# cat test.repo
4.清除yum源緩存:
# yum cleanall
5.檢驗(yàn)是否掛載成功(3737-成功)
# yum list | wc-l
6.用yum源安裝包
# yum install -y 需要安裝的包名稱
7.查看某個(gè)服務(wù)在當(dāng)前文件系統(tǒng)的位置
# which 包名稱