linux centos7設定靜態ip

2021-09-08 16:56:12 字數 708 閱讀 2493

centos7的網路ip位址配置檔案在 /etc/sysconfig/network-scripts 資料夾下,

使用當前區域網機器網絡卡名稱,windows系統:

使用ping語句測試需要使用的ip是否被使用

沒有被使用,則可以用

vi /etc/sysconfig/network-scripts/ifcfg-ens33

#修改和新增

bootproto="static" # 使用靜態ip位址,預設為dhcp

ipaddr="192.168.8.90" # 設定的靜態ip位址

netmask="255.255.255.0" # 子網掩碼

gateway="192.168.241.2" # 閘道器位址

dns1="192.168.241.2" # dns伺服器

然後使用service network restart命令即可配置靜態ip位址

Linux Centos7 設定MySql定時備份

一 檢視是否安裝了必要的元件 root localhost rpm qa grep cron cronie 1.4.11 14.el7 2.1.x86 64 cronie anacron 1.4.11 14.el7 2.1.x86 64 crontabs 1.11 6.20121102git.el7...

Linux centos7 防火牆設定

1.檢視防火牆狀態 systemctl list unit files grep firewalld.service 或systemctl status firewalld.service 2.開啟 systemctl start firewalld.service 3.停止 systemctl s...

Linux CentOS 7 防火牆 埠設定

centos公升級到7之後用firewall代替了iptables來設定linux埠,下面是具體的設定方法 選填 必填 作用域 block dmz drop external home internal public trusted work 埠號 或者埠範圍 埠協議 tcp udp 過期時間,使用...