Linux認證基礎知識:RedHat之查看和修改IP
首先是查看當前機器網卡的'IP
1.顯示當前啓動的網絡接口命令:
ifconfig
2.查看當前所有網絡接口命令:
ifconfig -a
3.查看指定網絡接口命令:
ifconfig eth0
在LINUX下修改IP分爲二種情況,
1.調試時修改IP,僅在當前生效,重啓後恢復爲原有IP
ifconfig eth0 netmask route add defaultgw up
2.永久生效(即重啓後也能生效)
方法1:配置網卡的配置文件
修改/etc/sysconfig/network-scripts/ifcfg-eth0
vi/etc/sysconfig/network-scripts/ifcfg-eth0 #第二塊網卡:vi/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth0#物理設備名
IPADDR=地址
NETMASK=#掩碼值
NETWORK=#網絡地址(可不要)
BROADCAST=#廣播地址(可不要)
GATEWAY=#網關地址
ONBOOT=yes #[yes|no](引導時是否激活設備)
USERCTL=no#[yes|no](非root用戶是否可以控制該設備)
BOOTPROTO=static#[none|static|bootp|dhcp](引導時不使用協議|靜態分配|BOOTP協議|DHCP協議)
然後重啓服務service network restart生效,或者/etc/init.d/networkrestart生效
方法2:
將ifconfig eth0 netmask route adddefault gw 保存在/etc/init.d/l文件中
相關文章
-
Linux認證基礎知識:RedHat之vi命令詳解
本文介紹了vi(vim)的基本使用方法,但對於普通用戶來說基本上夠了!vi編輯器是所有Unix及Linux系統下標準的編輯器,它的強大不遜色於任何最新的文本編輯器,這裏只是簡單地介紹一下它的用法和一小部分指令。由於對Unix及Lin -
託福英語寫作範文:Examinations exert a pernicious influence on educat
We might marvel at the progress made in every field of study, but the methods of testing a person’s knowledge and ability remain as primitive as ever they were. It really is extraordinary that after -
高中英語作文:My approach to difficulties in learning
某校英文報社開設了一個專欄:experience . 本期話題是如何解決學習中遇到的`困難。請你以“my approach to difficulties in leaing” 爲題,用英語寫一篇短文,談談自己的一些做法。 範文: My approach to difficulties -
九年級《unit 6 I like music that I can dance to. Period2》評課稿
朱老師是早上的第三節課,上的內容九年級unit 6 I like music that I can dance to. Period2, 這是一堂新授課,圍繞的主題是音樂,表達自己對音樂的喜好以及原因,主要學習由that 和who引導的定語從句。1. 朱老師教學基本功 -
Thinkpad筆記本開機顯示Tointerrruptnormalstartup解決方法
Thinkpad筆記本開機顯示To interrrupt normal startup的解決方法1、先等待5-6分鐘,如果系統又恢復了正常,說明可能是系統硬盤或者風扇區出了問題;2、假如過了5-6分鐘依然沒有反應,則可嘗試先拆掉筆記本電池在裝上;3、或 -
英語閱讀:African Union Leaders Talk Mali, Chinese Investmen
African leaders met in Ethiopia during the weekend to celebrate the 50th anniversary of their continental alliance and discuss issues such as Chinese investment on the continent as well as the fight a -
A Bitter Experience in My Childhood國中英語作文
Looking at the picture,I can't help remembering one episode of my childhood.I was ten then and studied in a primary all children,I like to play after school and hated to sit at the table working -
英語材料閱讀:with mental and physical disorders
The biggest differences between the Mensa group and the general population were seen for mood disorders and anxiety disorders. More than a quarter (26.7%) of the sample reported that they had been for -
Linux認證基礎知識:linux操作系統目錄結構
在現實生活或工作學習中,大家都經常接觸到作文吧,作文是一種言語活動,具有高度的綜合性和創造性。相信寫作文是一個讓許多人都頭痛的問題,下面是小編爲大家整理的游泳的作文,僅供參考,歡迎大家閱讀。游泳的作文1游泳既能鍛 -
A Letter to the University President爲題目的作文
Direction: For this part, you are allowed thirty minutes to write a composition on the topic: A letter to the university president about the canteen service on campus, you should write at least 100 words,