Networking

在執行 Scientific Linux 的 VirtualBox 來賓中配置橋接乙太網適配器

  • October 18, 2012

我在 Windows 7 x64 上的 VirtualBox 中安裝了 Scientific Linux 6.2 x86。

適配器是

Adapter 1: Paravirtualized Network (Bridged adapter, Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller)
promiscuous mode: Deny

但是這個適配器沒有得到 IP 地址。

[root@server ~]# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:40:5A:33:F2:92  
         inet6 addr: fe80::240:5aff:fe33:f292/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:0 (0.0 b)  TX bytes:398 (398.0 b)

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:16436  Metric:1
         RX packets:16 errors:0 dropped:0 overruns:0 frame:0
         TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:960 (960.0 b)  TX bytes:960 (960.0 b)

名單/etc/sysconfig/network-scripts

[root@server network-scripts]# ls
ifcfg-eth0   ifdown-eth   ifdown-ppp     ifup-aliases  ifup-isdn   ifup-routes       net.hotplug
ifcfg-eth1   ifdown-ippp  ifdown-routes  ifup-bnep     ifup-plip   ifup-sit          network-functions
ifcfg-lo     ifdown-ipv6  ifdown-sit     ifup-eth      ifup-plusb  ifup-tunnel       network-functions-ipv6
ifdown       ifdown-isdn  ifdown-tunnel  ifup-ippp     ifup-post   ifup-wireless
ifdown-bnep  ifdown-post  ifup           ifup-ipv6     ifup-ppp    init.ipv6-global

並且ifcfg-eth1

DEVICE=eth1
HWADDR=00:40:5a:33:f2:92
NM_CONTROLLED=yes
ONBOOT=no
BOOTPROTO=dhcp
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no

請告訴我如何獲取 eth1 的 IP 地址 192.168.0.x。

好吧,只要自己輸入IP地址:

ifconfig eth1 192.168.0.x

如果它不起作用,請進入特定虛擬驅動器的設置並通過您的虛擬適配器之一啟用您的網路選項。

您更有可能忘記在適配器上啟用混雜:

在此處輸入圖像描述

預設情況下,嗅探被拒絕。

引用自:https://unix.stackexchange.com/questions/34637