杨庆华 發表於 2020-9-18 22:34:00

Centos7/Debian 配置双网卡

<h1 id="centos7debian-配置双网卡">Centos7/Debian 配置双网卡</h1>
<ol>
<li>
<p>添加一块虚拟网卡</p>
<p><img src="https://img2020.cnblogs.com/blog/2005355/202009/2005355-20200918223322678-342552477.png" alt="" loading="lazy"></p>
</li>
<li>
<p><code>ifconfig</code>查看网卡device name,新建一个对应的配置文件<code>vim /etc/sysconfig/network-script/ifcfg-name</code></p>
<pre><code>TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens34
DEVICE=ens34
ONBOOT=yes
IPADDR=192.168.10.100
NETMASK=255.255.255.0
</code></pre>
<p>这里使用vmnet01 host-only,所以不需要设置网关</p>
</li>
</ol>
<h2 id="debian配置">Debian配置</h2>
<pre><code># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.80.200
netmask 255.255.255.0
broadcast 192.168.80.255
network 192.168.80.0
gateway 192.168.80.2


auto eth1
iface eth1 inet static
address 192.168.10.200
netmask 255.255.255
broadcast 192.168.10.255
</code></pre><br><br>
来源:https://www.cnblogs.com/kikochz/p/13693852.html
頁: [1]
查看完整版本: Centos7/Debian 配置双网卡