Centos7VMセットブリッジモード



Centos7 Vm Set Bridge Mode



1.仮想マシンの設定ページを開き、図に示すように仮想マシンのブリッジモードを設定します。ブリッジモードを選択します(物理ネットワーク接続をコピーする場合はオプション)。




次に、VMware仮想マシンネットワークをブリッジモードで構成します
1.ホストネットワーク情報を表示します。

画像



ipconfig /all Ethernet adapter Local connection: Connection specific DNS suffix......: Description..........: Realtek PCIe GBE Family Controller Physical address........: 44-37-E6-D2-D6-A5 DHCP is enabled.......: Yes Automatic configuration is enabled.......: Yes IPv4 address.........: 192.168.0.107 (preferred) Subnet mask.........: 255.255.255.0 Time to get the lease....... March 18, 2019 9:16:04 Time when the lease expires.......: March 20, 2019 5:38:07 Default Gateway........: 192.168.0.1 DHCP server.......: 192.168.0.1 DNS server.......: 192.168.0.1 192.168.0.1 NetBIOS over TCPIP....: Enabled 

画像

2. CentOS7を構成し、ホストの対応する情報を以下の対応する場所、静的IP、サブネットマスク、デフォルトゲートウェイ、DNSに入力します。

画像



vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 Explanation: The file ifcfg-eno16777736 may be different for everyone TYPE=Ethernet BOOTPROTO = static #Modify to static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=eno16777736 UUID=bf5337ab-c044-4af7-9143-12da0d493b89 DEVICE=eno16777736 ONBOOT = yes #Modify to yes PEERDNS=yes PEERROUTES=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPADDR = 192.168.0.200 # Customize the IP address of the virtual machine (the host is 192.168.0.107), which must be on the same network segment as the host NETMASK = 255.255.255.0 #Set the subnet mask, same as the host GETWAY = 192.168.0.1 #default gateway, same as host DNS1 = 192.168.0.1 #DNS, same as host IP address: Set the IP of the same network segment as the host NETMASK: The subnet mask is the same as the host GATEWAY: The default gateway is the same as the host DNS1: same as host

画像

3.ゲートウェイアドレスを追加します

画像

vi /etc/sysconfig/network The contents are as follows: NETWORKING=yes HOSTNAME = xxxx #The name is random GATEWAY = 192.168.1.1 #The default gateway is the same as the host

画像


4.DNSを追加します

vi /etc/resolv.conf The contents are as follows: # Generated by NetworkManager nameserver 192.168.0.1 #DNS, same as host

5.ネットワークを再起動します

service network restart



3.テスト
1.独自の静的IPへのイントラネットアクセス

画像

[root@xxxxx Desktop]# ping 192.168.0.200 PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data. 64 bytes from 192.168.0.200: icmp_seq=1 ttl=64 time=0.036 ms 64 bytes from 192.168.0.200: icmp_seq=2 ttl=64 time=0.043 ms 64 bytes from 192.168.0.200: icmp_seq=3 ttl=64 time=0.047 ms 64 bytes from 192.168.0.200: icmp_seq=4 ttl=64 time=0.046 ms 

画像


2.パブリックネットワークにアクセスします

画像

[root@xxxxx Desktop]# ping www.baidu.com PING www.a.shifen.com (180.97.33.108) 56(84) bytes of data. 64 bytes from 180.97.33.108: icmp_seq=1 ttl=57 time=2.52 ms 64 bytes from 180.97.33.108: icmp_seq=2 ttl=57 time=2.04 ms 64 bytes from 180.97.33.108: icmp_seq=3 ttl=57 time=3.20 ms 64 bytes from 180.97.33.108: icmp_seq=4 ttl=57 time=2.20 ms 64 bytes from 180.97.33.108: icmp_seq=5 ttl=57 time=3.56 ms 

画像


3.ホストマシンが仮想マシンにアクセスします

画像

C:UsersAdministratorDesktop ping 192.168.0.200 Ping 192.168.0.200 with 32 bytes of data: Reply from 192.168.0.200: byte = 32 time <1ms TTL = 64 Reply from 192.168.0.200: byte = 32 time <1ms TTL = 64 Reply from 192.168.0.200: byte = 32 time <1ms TTL = 64 Reply from 192.168.0.200: byte = 32 time <1ms TTL = 64 Ping statistics of 192.168.0.200: Packet: Sent = 4, Received = 4, Lost = 0 (0% lost), Estimated time of round trip (in milliseconds): Shortest = 0ms, Longest = 0ms, Average = 0ms

画像

4.仮想マシンアクセスホスト

画像

[root@xxxxx Desktop]# ping 192.168.0.107 PING 192.168.0.107 (192.168.0.107) 56(84) bytes of data. 64 bytes from 192.168.0.107: icmp_seq=1 ttl=128 time=0.487 ms 64 bytes from 192.168.0.107: icmp_seq=2 ttl=128 time=0.408 ms 64 bytes from 192.168.0.107: icmp_seq=3 ttl=128 time=0.394 ms 64 bytes from 192.168.0.107: icmp_seq=4 ttl=128 time=0.362 ms 64 bytes from 192.168.0.107: icmp_seq=5 ttl=128 time=0.401 ms 64 bytes from 192.168.0.107: icmp_seq=6 ttl=128 time=0.398 ms 64 bytes from 192.168.0.107: icmp_seq=7 ttl=128 time=0.434 ms ^C --- 192.168.0.107 ping statistics --- 7 packets transmitted, 7 received, 0% packet loss, time 6005ms rtt min/avg/max/mdev = 0.362/0.412/0.487/0.036 ms

画像


インターネットにpingできない場合は、次のネットワークカードを選択する必要があります。

VMwareメニューバー->編集->仮想ネットワークエディター

切り替えを行い、保存してみて、 このステップは非常に重要です。画面にVMnet0が表示されない場合は、権限が不足している可能性があります。右下隅にある[設定の変更]をクリックします。

VMware仮想ネットワークカードの説明:
ネットワークタイプネットワークアダプタ名
ブリッジVMnet0
NAT VMnet8
ホストのみのVMnet1