Centos6.8 configure a static ip and external network accessible

1 - off windows firewall

Control Panel \ All Control Panel Items \ Windows Defender Firewall

2- Close liunx firewall

service iptables stop
[hadoop@hadoop ~]$ sudo iptables -F
[hadoop@hadoop ~]$ sudo iptables -F

3- open the windows of two services

DHCP (Dynamic Host Configuration Protocol, Dynamic Host Configuration Protocol)
is generally used in large local area network environment, the main role is to centralize the management, assign an IP address, the host to dynamic network environments to obtain an IP address, Gateway address, DNS server addresses and other information, and be able to enhance the utilization of addresses.
NAT (Network Address Translation, Network Address Translation)
is converted by a specific network address (intranet Intranet) a public address (such as the Internet Internet), thereby hiding the external IP address of the internal management.
My Computer \ Management \ Services and Applications \ Services
VMware the DHCP Service
VMware NAT Service

4- local network configuration shared VMware8

Control Panel \ Network and Internet \-Fi
Control Panel \ Network and Internet \ Network and Sharing Center \ Change adapter settings
Ethernet \ Right - Properties \ shared \ two tick ✔

5-ipconfig -all command to view Ethernet and VMware8 the ip and dns

Ethernet
DNS server:........... 192.168.0.1

VM8
IPv4 address:....... ..... 192.168.137.1 ( preferred)
subnet mask..... .......: 255.255.255.0

6- VM8 configuration of IP and DNS

The query just to fill VM8 the ip and subnet mask came

7 - Set VMware Virtual Network Editor

1) Select the installed virtual machine, edit \ Virtual Network Editor

2) IP subnet, and the front IPv4 VM8 same three groups, represented by 0 later
acquired administrator privileges provided --DHCP

3) NAT gateway IP configuration settings

4) configure IP range, the back fill within the required range of IP

8- network adapter configuration NAT mode


9- modify ifcfg-eth0 network card configuration

[root@hadoop002 Desktop]vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:28:10:A1
TYPE=Ethernet
UUID=edff953f-ed69-40af-8f84-aa27952e3e03
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.137.130
MASK=255.255.255.0
GATEWAY=192.168.137.2
DNS1=192.168.0.1

10- restart Network

service network restart

Or /etc/init.d/network restart

Network authentication check 11-

ping www.baidu.com

Guess you like

Origin www.cnblogs.com/david227/p/11819829.html