CentOS設定靜態IP

2021-09-02 12:23:20 字數 2704 閱讀 7352

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

onboot=yes

nm_controlled=yes

bootproto=static

ipaddr=172.19.1.35

netmask=255.255.255.0

gateway=172.19.1.1

networking_ipv6=no

ipv6init=no

ipv6_autoconf=no

dns1=222.246.129.81

dns2=222.246.129.80

service network restart

遠端桌面設定:

vim /etc/gdm/custom.conf

改為以下內容:

# gdm configuration storage

[daemon]

[security]

disallowtcp=false

allowremoteroot=true

[xdmcp]

enable=true

port=177

[greeter]

[chooser]

[debug]

用xmanager連線

安裝中文:yum install "@chinese support" 

防火牆設定:

/etc/sysconfig/iptables

安裝極點五筆:

yum remove ibus

yum install ibus ibus-table

cp vissible.db /usr/share/ibus-table/tables

cp vissible.gif /usr/share/ibus-table/icons

1

2

date–s'1987-05-02 10:10:10'

clock –w//將日期寫入cmos

補充:

修改linux時間一般涉及到3個命令:

1

2

3

date:修改系統當前的時間

hwclock:修改系統硬體時間

hwclock 用法:1

2

hwclock --show//檢視硬體時鐘

hwclock --set--date="1/23/01 22:16:59"//設定硬體時鐘

系統環境:centos 6.5

問題復現:將當前系統時間設定為前幾天的某個時間,然後重啟系統。

一、問題分析:

從上面截圖紅框處的提示可知:

/dev/sda2:superblock last mount time(mon jan 13 04:47:28 2014,now = fri jan 10 11:02:20 2014) is in the future.

大概意思是sda分割槽最後一次掛載時間(mon jan 13 04:47:28 2014)是在未來(當前時間是fri jan 10 11:02:20 2014),有問題。

二、解決辦法:

解決辦法還得看上面的截圖最後幾句話。

give root password for maintenance

(or type control-d to continue):

這兩句話的意思是:

輸入root使用者密碼進入維護,或者按「ctrl+d」鍵繼續。

如果按「ctrl+d」鍵繼續,系統還是無法啟動的,會回到上面報錯的介面,所以只能在「(or type control-d to continue):」這行後面輸入root使用者密碼,回車,進入維護模式。

進入維護模式後,用fsck命令修復錯誤資訊提示的分割槽即可。

如果修復乙個磁碟分割槽還不行,可能有多個分割槽要修復,乙個乙個修復即可。

fsck命令修復完成後,reboot,然後系統就能正常啟動了!

ps:此方法亦適用於redhat。

1.檢視物理cpu個數

grep 'physical id' /proc/cpuinfo | sort -u | wc -l

2.檢視核心數量

grep 'core id' /proc/cpuinfo | sort -u | wc -l

3.檢視執行緒數

grep 'processor' /proc/cpuinfo | sort -u | wc -l

4.檢視cpu型號

dmidecode -s processor-version

最簡單的方法是

# shopt -s extglob      (開啟extglob模式)

# rm -fr !(file1 | file2)

centOS靜態IP設定

編輯檔案 vi etc sysconfig network script ifcfg eth0 1.動態獲取ip onboot yes mm controlled no bootproto dhcp 2.靜態ip device eth0 type ethernet hwaddr 00 0c 29 5...

centos 設定靜態IP

我們的centos中配置的是nat host only的雙網絡卡網路配置,所以將兩個網絡卡均設定為靜態。小夥伴兒們可以根據自己的情況按教程設定即可。關於雙網絡卡的設定實現宿主機和虛擬機器互通,並且可以上網的問題,請參考另一篇博文 虛擬機器與宿主機網路配置 可互通可上網 1 配置前首先檢視系統的雙網絡...

centos 設定靜態ip

w cd etc sysconfig network scripts xx為使用者自己目錄下的ifcfg xx 檔案 vi etc sysconfig network scripts ifcfg xx 2.修改如下配置內容 bootproto static 將dncp改為static onboot ...