About linux connection.

Source: Internet
Author: User
About linux connection. The younger brother used the VirtualBox virtual machine to install linux (centos). he wanted to manually set up the network, but he tried many times and did not connect to it. please give me some advice from a senior, thank you first.

Manual settings:


My IP:


Network settings:


Reply to discussion (solution)

You don't need to manually get it automatically, should you?

Set IPv4 to automatic (DHCP), or set it to manual as you do. The DNS server should be 8.8.4.4.
In addition, IPv6 must be set to ignore, and then 802.1 should not be enabled first. This should be done.

Local
Ip 192.168.102.1 mask 255.255.255.255.255.0
Vbox
Ip 192.168.51.1 mask 255.255.255.255.255.0
There is no network segment at all. how can we communicate with each other?

Automatic acquisition is not acceptable. Obviously, his virtual machine is intended to run the amp

Set the same network segment as the real machine in the virtual machine. the IP address of the real machine does not need to be moved.
The PING failure may be caused by the following four reasons:
1. the NIC or ip address is incorrect. in linux, how does one set the IP address?
There are two ways: temporary and permanent.
[Temporary settings]: ifconfig eth0 192.168.180.200
[Permanent settings]: vi/etc/sysconfig/network-scripts/ifcfg-eth0
Edit the following content:
DEVICE = eth0
BOOTPROTO = none or static
ONBOOT = yes
IPADDR = 192.168.0.103
Save and exit! : Wq
Then, restart the NIC to take effect. run the command "service network restart ".
2. firewall impact; linux:
Disable linux firewall: iptables-F
SELinux:
Run the sestatus command to check whether SELinux is enabled. if the returned information is not disabled, it indicates that SELinux is not completely closed.
If you want to close the configuration file completely, you only need to modify the configuration file, execute vi/etc/selinux/config, set the 6th behavior SELINUX = disabled, and then save and exit: wq
And must be restarted to take effect!
3. the ssh service in linux is not enabled; check whether the remote connection service is enabled: ps-le | grep sshd
If no information is returned, the service is not enabled.
Enable service: service sshd start
4. affected by some security products such as 360.

Virtual machines can automatically obtain the network. As long as you set it on the VM, it is consistent with the local network segment.

The problem has been solved. thank you for your help. thank you!

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.