2 qq 26156419 qq_26156419 于 2016.04.12 21:47 提问

linux vmware下的eth1和eth2配置不成功 30C

对一台vmare上的Linux 进行了如下配置:

    auto eth0
    iface eth0 inet static
    address 192.168.0.21
    gateway 192.168.0.1
    netmask 255.255.255.0
    dns-nameservers 192.168.0.1

    auto eth1
    iface eth1 inet static
    address 192.168.1.21
    gateway 192.168.0.1
    netmask 255.255.255.0
    dns-nameservers 192.168.0.1

    auto eth2
    iface eth2 inet manual
    up ip link set dev $IFACE up
    down ip link set dev $IFACE down

然后输入命令ifconfig -a,得到:

    br-ex     Link encap:Ethernet  HWaddr 0a:45:d7:ce:c5:45  
      BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

br-int Link encap:Ethernet HWaddr 8e:6c:da:0c:7c:4c

BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth0 Link encap:Ethernet HWaddr 00:0c:29:0e:c1:66

inet addr:192.168.0.21 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe0e:c166/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:65846 errors:0 dropped:0 overruns:0 frame:0
TX packets:25384 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40230877 (40.2 MB) TX bytes:2617693 (2.6 MB)

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:16546 errors:0 dropped:0 overruns:0 frame:0
TX packets:16546 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:830892 (830.8 KB) TX bytes:830892 (830.8 KB)

ovs-system Link encap:Ethernet HWaddr 2e:19:95:31:93:8f

BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

本机上只有两张虚拟网卡vmnet1和vmnet8,选择的网络连接方式是桥接,请问各路大牛,我该如何配置才可以使eth1和eth2生效,请尽量详细点,小弟是新手

3个回答

weisia
weisia   2016.04.12 21:52

首先你要选择桥接模式, 其次要将eth1 和eth2 配置成和 物理机器网卡同一网段即可。 比较重要的是需要关闭防火墙。。

ouchao0727
ouchao0727   2016.04.13 09:20

把你配置的网络up一下

hijack00
hijack00   Rxr 2016.08.22 19:22

eth2的配置我没看懂,但是你eth1的配置中网卡地址和网关以及dns都不在同一网段,肯定会出问题,除非你配置了路由表。将eth1的地址改为和网关和dns同一网段,并且可以ping通,然后重启一下网络服务看看

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!