在装好的虚拟中添加网卡,不会产品ifcfg-ethl之类的文件,需要手动复制ifcfg-ethl,如果需要
到MAC地址,就用ifconfig把查看到的相应 MAC地址写到配制文件
1. root用户登录,用ifconfig看网卡是否正常。
Linux默认是 DHCP获取ip,当网络中没有 DHCP,则会请求超时,而造成网卡无法启动, 不过网卡不启动也没关系,只要确认lsmod中网卡驱动模块已经正常加载了就可以了,然后我
们需要修改网卡配置文件。
[root@localhost network-scripts]# ifconfig
etho
Link encap:Ethernet HWaddr 00:0c:29:c0:32:dd
Inet addr:1D.0.1.92 Beast:10. 0,1. 255 Mask:255.255.255.0 inetb addr: fefiO::20c:29ff:fec0:32dd/64 scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4237 errors:Q dropped:o overruns:0 frame:Q tx packets:587 errors:0 dropped:0 overruns:0 carrier:0 coliisions:0 txqueuelen:1000
RX bytes:297053 (290.0 KlB^ TX bytes:57600 (56,2 KiB) interrupt;19 Base address:0x2000
ethl
Link encap:Ethernet Hwaddr 00;0c:29;CO:32:E7 inet addr :10.0.1.93 Bcasr :10. 0. 1. 255Mask:255. 255. 255. 0
1net6 addr: fe80::20c:29ff:fec0:32e7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric :1
Rx packets:2264 errors;0 dropped:0 overruns:0 frame:0 TX packets:16 errors:O dropped:0 overruns:0 carrier:0 colllsions:0 txqueuelen:1000
RX bytes :1544B9 (150. 8 K1B) TX: bytes : 992 ($92.0 b) interrupt:19 Base address:0x20呂0
Io
Link encap:Local Loopback inet addr0.0,1Mask:255.QF 0.0
inetS addr: ::1/12B scope:Host
UP LOOPBACK RUNKING MTU:16436 Metrical
RX packets:0 errorsdropped:0 overruns:0 frante:0 tx packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:O
rx bytes:0 (0.0 b) tx bytes:0 (0.0 b)
2.新建虚拟绑定网卡 bond0
执行cd /etc/sysconfig/network-scripts进入网卡配置文件目录
这个目录下会有网卡的配置文件
ifcfg-ethO 对应 ethO
拷贝 ifcfg-ethO 为 ifcfg-bondO
troot^serverl network^scripts]# cp ifcTg-eth6_lfcrg-l>0Tide [root(3serverl network'scripts]# l&
ifcfg-bondO _ Jown-bnep Ifdown-lsdn?、.: - si
ifcfg-ethOifdown-ethlfdown-po^tiTdcv/n-tunnel
ifcfg-ethllfdown-lpppir(Jown-pppifup
if cfg-loIfdwn-lpsec mown- routes : up - al tasei
f f downif fl owf^ - x d v6i. f d own 丁性 j "ti f u -:Bn □曲
[root^serverl network- scripts]^ |:
3.编辑网卡配置文件
编辑ifcfg-bond0文件
#vi ifcfg-b ondO
原配置文件如