Linux认证基础知识:RedHat之查看和修改IP
来源:才华咖 本文已影响1.25W人
来源:才华咖 本文已影响1.25W人
首先是查看当前机器网卡的'IP
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文件中
英语阅读:Covergirl unveils empowering brand update
Linux认证基础知识:linux操作系统目录结构
2016年Linux认证基础知识:php做权限管理
初中英语写作范文:My Happy Times During Winter Vacation
牛津深圳版英语九下Unit1《Greatexplorations》Reading说课稿
A Letter to the University President为题目的作文
英语阅读:Dollar Hit by Trump Tax Plan Doubts
Should Private Cars Be Encouraged in China高中英语作文
Linux认证基础知识:Linux中正则表达式与文件处理
英语材料阅读:with mental and physical disorders
Thinkpad笔记本开机显示Tointerrruptnormalstartup解决方法
英语阅读:African Union Leaders Talk Mali, Chinese Investmen
Health in developing countries大学六级英语写作范文
A Bitter Experience in My Childhood初中英语作文
英语报纸解读:Data may disrupt a peculiar business大纲
Module 6 Unit 1 I went there last year教学反思
最新《Fate/Stay Night Unlimited Blade Works》经典名句
Linux认证基础知识:RedHat之查看和修改IP
人教版初一上册英语期中考试知识点:Unit3Isthisyourpencil
英语阅读:Are You Tricked by These Optical Illusions
英语短文:City Life Compared with Rural Life
导游证《基础知识》强化基础题
七年级英语Unit2Is this your pencil Period1说课稿
Cultivate Your ReadingHabit培养阅读习惯方法
四年级上册Module8 UNIT1 What did she play说课稿
公开课Module 7 Unit 1 Happy Birthday教学设计总结
英语作文阅读:Bad News for the Highly Intelligent
新闻写作基础知识
Jolie drops battle over perfume named Shilohy英语作文
英语阅读推荐:How to protect cultural identity
英语情景口语:Chapter 2 Introducing an Apartment
英语口语:Teaching and Learning Responsibility
Should Internet Slang Be Prohibited英语作文
A Lifeguard at Johns Beach Saved a Drowning Child,A Lifeguar英语作文
Unit3Onlinetravel(SpeakupandStudyskills)学案
On the losing of Traditional Culture英语四级作文
八年级英语下册Unit 6 An old man tried to move a Mountain period one说课稿
英语阅读:VIT declines to acquire Ang Mo Kio property
公文写作基础知识(基础知识)
英语作文:Gulangyu,A fairyland in the world