Linux双网卡配置的步骤如下:查看网卡信息
Linux双网卡配置的步骤如下:
1、查看网卡信息
首先,使用ifconfig命令查看当前系统中的网卡信息,例如:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:6F:A7:8B
inet addr:192.168.1.100 ast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1520 (1.5 KB) TX bytes:1520 (1.5 KB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:6F:A7:8C
inet addr:192.168.2.100 ast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1520 (1.5 KB) TX bytes:1520 (1.5 KB)
2、编辑网卡配置文件
接下来,使用vi或者nano编辑器编辑/etc/network/inteces文件,加入以下内容:
# The primary network intece
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
# The secondary network intece
auto eth1
iface eth1 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1
3、重启网络服务
最后,重启网络服务,使新的配置生效:
# /etc/init.d/networking restart
重启后,使用ifconfig命令查看网卡信息,两个网卡都应该已经配置好了。
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(32条)