在virtualbox里面增加一个网卡

简介: 增加第三个网卡,进入linux,

image.png增加第三个网卡,进入linux,

[root@jia ~]# cd /etc/sysconfig/network-scripts/
[root@jia network-scripts]# ls
ifcfg-eth0  ifdown       ifdown-ippp  ifdown-post    ifdown-sit     ifup-aliases  ifup-ippp  ifup-plip   ifup-ppp     ifup-tunnel       net.hotplug
ifcfg-eth1  ifdown-bnep  ifdown-ipv6  ifdown-ppp     ifdown-tunnel  ifup-bnep     ifup-ipv6  ifup-plusb  ifup-routes  ifup-wireless     network-functions
ifcfg-lo    ifdown-eth   ifdown-isdn  ifdown-routes  ifup           ifup-eth      ifup-isdn  ifup-post   ifup-sit     init.ipv6-global  network-functions-ipv6
[root@jia network-scripts]# cp ifcfg-eth0 ifcfg-eth2
[root@jia network-scripts]# vi ifcfg-eth2
[root@jia network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down interface eth1:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
                                                           [  OK  ]
Bringing up interface eth1:  
Determining IP information for eth1... done.
                                                           [  OK  ]
Bringing up interface eth2:  
Determining IP information for eth2... done.
                                                           [  OK  ]
[root@jia network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:31:84:F8  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe31:84f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6132 (5.9 KiB)  TX bytes:7750 (7.5 KiB)
eth1      Link encap:Ethernet  HWaddr 08:00:27:C2:E9:84  
          inet addr:192.168.56.102  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec2:e984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:883 errors:0 dropped:0 overruns:0 frame:0
          TX packets:593 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:81646 (79.7 KiB)  TX bytes:98672 (96.3 KiB)
eth2      Link encap:Ethernet  HWaddr 08:00:27:1A:50:5D  
          inet addr:192.168.87.156  Bcast:192.168.87.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe1a:505d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3773 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:227627 (222.2 KiB)  TX bytes:1452 (1.4 KiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:9798 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9798 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1758199 (1.6 MiB)  TX bytes:1758199 (1.6 MiB)
[root@jia network-scripts]# 

修改eth2的参数参考

[root@jia rules.d]# cat 70-persistent-net.rules 
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:31:84:f8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:c2:e9:84", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:1a:50:5d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
[root@jia rules.d]# 
相关文章
|
虚拟化
74Linux - VMware虚拟机三种联网方法( Brigde桥接:默认使用VMnet0 )
74Linux - VMware虚拟机三种联网方法( Brigde桥接:默认使用VMnet0 )
86 0
|
虚拟化
【虚拟化】VMware 新增网卡后找不到网卡配置问题(已解决)
【虚拟化】VMware 新增网卡后找不到网卡配置问题(已解决)
1258 0
【虚拟化】VMware 新增网卡后找不到网卡配置问题(已解决)
|
7月前
|
Linux 虚拟化
VMware workstation 中centos7虚拟机在nat模式下怎么配置网卡,指定我想要的IP并且可以联网
https://blog.csdn.net/2302_78534730/article/details/132825156?spm=1001.2014.3001.5502
324 0
|
Ubuntu
ubuntu 网卡配置 无法启动网卡
ubuntu 14 启动网卡失败
756 0
|
虚拟化 网络虚拟化
如何设置esxi的网卡与网络
很多朋友安装了vmware esxi后,不懂得服务器上的网卡该如何设置以及如何使用,我们在这里来介绍一下vmware esxi的网卡设置 工具/原料   一台服务器,配有两块千兆网卡 在服务器安装好vmware esxi 5.
1871 0
|
传感器 虚拟化 网络虚拟化