CentOS set static IP and access to extranet

Source: Internet
Author: User

1. Set the network adapter for the virtual machine to NAT mode

2. Edit the Virtual network editor

selected VMNet8 Change Settings

Sub-network ip:192.168.101.0

Subnet Mask: 255.255.255.0

NAT Set

Gateway: 192.168.101.2

DHCP Set

Start Address: 192.168.101.128

End Address: 192.168.101.254

3. Host VMNET8 Change adapter settings

IP Address: 192.168.101.1

Subnet Mask: 255.255.255.0

None of the rest is set.

4. Virtual machine static IP settings

Right-click Network icon, Edit Connections, IPV4 Settings

Method:manual

address:192.168.101.128

netmask:255.255.255.0

gateway:192.168.101.2

DNS servers:192.168.101.2

Search Domains:localdomain

5. Test out-of-network access

Ping www.baidu.com

Host is connected with Xshell

Configuration Results View:

-----------------------------------------------------------------

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device= "Eth0"

Bootproto=none

ipv6init= "Yes"

Nm_controlled= "Yes"

onboot= "Yes"

Type= "Ethernet"

Uuid= "aa8f2b19-fea9-4d05-a84c-fa419abc4537"

ipaddr=192.168.101.128

Prefix=24

gateway=192.168.101.2

dns1=192.168.101.2

Domain=localdomain

Defroute=yes

Ipv4_failure_fatal=yes

Ipv6_autoconf=yes

Ipv6_defroute=yes

Ipv6_failure_fatal=no

Name= "System eth0"

hwaddr=00:0c:29:f2:17:46

Ipv6_peerdns=yes

Ipv6_peerroutes=yes

last_connect=1469458152

Vi/etc/sysconfig/network

Networking=yes

Hostname=localhost.localdomain

Vi/etc/resolv.conf

# Generated by NetworkManager

Search Localdomain

NameServer 192.168.101.2

-----------------------------------------------------------------

CentOS set static IP and access to extranet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.