centos 7 0 單網絡卡配置雙ip雙網段

2021-09-24 19:01:14 字數 549 閱讀 2596

網絡卡配置檔案目錄:/etc/sysconfig/network-scripts/

網絡卡檔案只配置乙個閘道器,另外路由加在啟動檔案/etc/rc.local中

bootproto=static

defroute=yes

name=em1

uuid=87a971cc-c6e7-47d4-919a-92e968fb974c

device=em1

onboot=yes

ipaddr1=192.168.2.84

prefix1=24

gateway1=192.168.2.1

ipaddr2=10.2.3.84

prefix2=24

dns1=8.8.8.8

dns2=8.8.4.4

下面這句 放在啟動指令碼中

route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.2.3.1

7.0版本 rc.local預設無執行許可權,增加許可權後,即可啟動

chmod +x /etc/rc.d/rc.local

centos 7 0 單網絡卡配置雙ip雙網段

網絡卡配置檔案目錄 etc sysconfig network scripts 網絡卡檔案只配置乙個閘道器,另外路由加在啟動檔案 etc rc.local中 bootproto static defroute yes name em1 uuid 87a971cc c6e7 47d4 919a 92e...

CentOS 7 0 配置防火牆

1.centos 7.2 解決centos採用firewalld來管理防火牆,棄用iptables的解決辦法 使用firewalld來開放埠,對防火牆的簡單操作1.停止iptables服務 systemctl stop iptables.service2.啟動 firewalld服務 systemc...

CentOS 7 0配置php環境總結

這篇博文講得比較全面centos7安裝php mysql apache 缺點是由於我系統是新裝的,所以防火牆80埠沒開,記錄一下 apache預設就是使用80埠 防火牆開放80埠外部訪問 firewall cmd permanent zone public add port 80 tcp 新增80埠...