配置網路位址

2021-08-16 21:47:27 字數 1004 閱讀 6042

配置網路位址

1.永久配置ip位址  /etc/sysconfig/network-scripts/ifcfg-eth0

2.永久配置主機名  vim /etc/hostname   格式:主機名.tedu.cn

nmcli連線管理

1.檢視nmcli命令識別的網絡卡名字

nmcli  connection show

2.配置ip位址

[root@server0 ~]# nmcli connection modify 'system eth0' ipv4.method manual  ipv4.addresses '172.25.0.110/24  172.25.0.254'  connection.autoconnect  yes

nmlic      連線網路配置   『網絡卡識別的名字』

ipv4.method 配置ip位址的方法,auto自動獲取  manual手動配置

connection.autoconnect yes  開機自啟

3.啟用配置

nmcli connection up 『system eth0』

route   #檢視閘道器位址     gateway

4.重置網路環境

rht-vmctl reset 主機名   

dns伺服器配置(domain name server)

dns伺服器:虛擬機器classroom

配置檔案:/etc/resolv.conf

[root@localhost desktop]# vim /etc/resolv.conf        (填寫解析的ip)

[root@localhost desktop]# nslookup desktop0.example.com

server:        172.25.254.254

address:    172.25.254.254#53

name:    desktop0.example.com

address: 172.25.0.10

Centos 配置網路位址

檢視網路裝置 網路配置資訊的路徑 etc sysconfig network scripts ip addr設定網路位址 自動獲取網路位址 device eth0 hwaddr 00 0c 39 ad 11 48 type ethernet uuid c230a1e5 a535 487a aab5 ...

配置靜態網路位址

主機名 server0.example.com 子網掩碼 255.255.255.0 預設閘道器 172.25.0.254 dns伺服器 172.25.254.254 使用nmcli配置網路連線時的基本操作 檢視網路連線 連線詳情 修改網路連線引數 實現此案例需要按照如下步驟進行。1 配置前,檢查是...

Linux 命令配置網路位址

auto eth0 開機自動連線網路 iface lo inet loopback allow hotplug eth0 iface eth0 inet static static表示使用固定ip,dhcp表述使用動態ip address 198.9.146.131 設定ip位址 netmask 2...