国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

Linux下修改主機IP、主機名

2020-05-27 13:13:17
字體:
來源:轉載
供稿:網友

   1. 修改網絡配置

  Last login: Sat Sep 6 17:33:02 2014

  [root@centos ~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0

  --修改前

  # Intel Corporation 82540EM GigabitEthernet Controller

  DEVICE=eth0

  BOOTPROTO=dhcp

  ONBOOT=yes

  HWADDR=08:00:27:80:63:5b

  ~

  ~

  --修改后

  # Intel Corporation 82540EM GigabitEthernet Controller

  DEVICE=eth0

  BOOTPROTO=static

  IPADDR=10.53.105.65

  NETMASK=255.255.255.0

  ONBOOT=yes

  HWADDR=08:00:27:80:63:5b

  ~

  [root@centos ~]# service network restart

  Shutting down interface eth0: [ OK ]

  Shutting down loopback interface: [ OK ]

  Bringing up loopback interface: [ OK ]

  Bringing up interface eth0: RTNETLINK answers: Invalid argument

  [ OK ]

  2. 修改hosts配置

  [root@centos ~]# vi /etc/hosts

  # Do not remove the following line, orvarious programs

  # that require network functionality willfail.

  127.0.0.1 centos localhost.localdomainlocalhost

  ::1 localhost6.localdomain6 localhost6

  10.53.105.65 hyldb

  ~

  ~

  3. 修改network配置

  [root@centos ~]# vi /etc/sysconfig/network

  --修改前

  NETWORKING=yes

  NETWORKING_IPV6=yes

  HOSTNAME=centos

  GATEWAY=10.53.105.255

  ~

  ~

  --修改后

  NETWORKING=yes

  NETWORKING_IPV6=no

  HOSTNAME=hyldb

  GATEWAY=10.53.105.255

  ~

  ~

  --重啟系統,使配置生效

  [root@centos ~]# reboot

  Broadcast message from root (pts/3) (SunSep 7 00:00:08 2014):

  The system is going down for reboot NOW!

  重啟后效果如下:

  Last login: Sat Sep 6 23:55:38 2014 from 10.53.105.69

  [root@hyldb ~]# ifconfig

  eth0 Link encap:Ethernet HWaddr08:00:27:80:63:5B

  inet addr:10.53.105.65 Bcast:10.53.105.255 Mask:255.255.255.0

  inet6 addr: fe80::a00:27ff:fe80:635b/64 Scope:Link

  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

  RX packets:44 errors:0 dropped:0 overruns:0 frame:0

  TX packets:73 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:1000

  RX bytes:5283 (5.1 KiB) TXbytes:10654 (10.4 KiB)

  lo Link encap:Local Loopback

  inet addr:127.0.0.1 Mask:255.0.0.0

  inet6 addr: ::1/128 Scope:Host

  UP LOOPBACK RUNNING MTU:16436 Metric:1

  RX packets:5900 errors:0 dropped:0 overruns:0 frame:0

  TX packets:5900 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:0

  RX bytes:10634248 (10.1 MiB) TXbytes:10634248 (10.1 MiB)

  [root@hyldb ~]#  hostname

  hyldb

  [root@hyldb ~]#

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 临夏市| 弥勒县| 湛江市| 蓬安县| 定襄县| 澎湖县| 吉木乃县| 临洮县| 济源市| 江孜县| 灌云县| 松阳县| 宜都市| 宣城市| 上虞市| 广东省| 根河市| 抚顺县| 泗阳县| 乐山市| 商水县| 潼关县| 蓬安县| 安顺市| 大同市| 桐梓县| 鲁山县| 水城县| 攀枝花市| 木兰县| 临沂市| 内乡县| 茌平县| 崇明县| 遂昌县| 南华县| 长垣县| 昂仁县| 云龙县| 赤水市| 简阳市|