CentOS雙網絡卡配置預設路由

2021-10-13 02:57:55 字數 420 閱讀 1183

centos雙網絡卡,我們只需要乙個預設路由,如果兩個都有或都沒有會有一系列的問題

1.先route -n

檢視路由配置

2.如果需要將 ifcfg-eth1 設定為預設路由

修改 /etc/sysconfig/network-scripts/ 下 ifcfg-eth1

網絡卡配置檔案中

defroute=yes

即可3.重啟

systemctl restart network

或者手動設定

route del

-net 0.0.0.0/0 gw 192.168.101.253

ip -4 route add default via 192.168.101.253 dev eth0 metric 1002

CentOS雙網絡卡配置預設路由

centos使用雙網絡卡時,如果要指定其中乙個網絡卡的閘道器作為預設路由,不能直接用route命令進行修改,或者只是刪除其中乙個預設路由。例如 expert sec cpsc 8001sz 0 ifconfig eth0 link encap ethernet hwaddr 00 50 56 a6 ...

centos 雙網絡卡配置

對centname計算機進行配置 內網 em1 192.168.10.201 外網 em2 202.0.146.223 vi etc sysconfig network scripts ifcfg em2修改以下配置 device em2 type ethernet uuid d056c517 48...

centos雙網絡卡配置

對於學校來說 鳥哥的這種配置方案挺可行的。然後就會有一塊網路界面對內 假設為eth1 一塊網路介面對外 eth0 一 配置 etc sysconfig network scripts ifcfg eth0 1 如果是自動分配ip 示例 device eth0 onboot yes bootproto...