Linux Basic Environment Settings __linux

Source: Internet
Author: User

Linux Basic Environment Settings

Here we have a few things to set up:

* Static IP: Why the need to set static IP (usually use Linux system is required to provide services, as the server needs a fixed IP address, is a static IP address. This will make it possible for clients to access this Linux server normally. )

* Hostname: Host name, when the host a lot of time, you need to be able to clearly distinguish between different hosts

* Network Map: Mapping between host name and its IP

* DNS domain name Resolution link extranet: Need gateway Configuration

Ifconfig (ipconfig in Windows) system Admin command to view the network basic information of the system

How the virtual machine is connected to the network

(1) Bridge connection

-Automatically obtain IP address, associated with native physical network

-You can understand that the network of the virtual machine and the physical network of this computer are using a cable

(2) NAT (recommended use of NAT)

-Create a virtual network space in a virtual machine, and virtual a network to connect

-VMnet8

-Can go to specify a static IP

1. Set Static IP

-Click Virtual Machine "edit" "Virtual Network Editor"

-IP address range: 1-255, general recommendations 1 and 2 do not set

-Before setting IP, look at the current network segment, for example: 192.168.237 network Segment

-DHCP is a service that automatically obtains IP addresses

-Gateway is gateways

IP we can select an IP for the segment such as 192.168.237.128

Look here to get the gateway for 192.168.237.2

Subnet mask is 255.255.255.0

Configure the network below

When Setup is complete, it is recommended that the network be restarted to take immediate effect

Command line mode: Service network restart

Static IP can also be set by command line

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

Restart Network services: Service Network restart

2, hostname

View the host name of the current system

Hostname

The setting specification (1) name of the host name should be meaningful (2) format recommended: Host name. Domain Name

The first way to set host names: temporary modifications (valid only for current shell sessions)

The second way to set the host name: permanently in effect

(1) Vi/etc/sysconfig/network

(2) Enter the file, press I to enter the edit state

(3) When editing is complete, press ESC to exit Edit status

(4) Press shift+: Then enter the last line mode

(5) Press Wq to save and launch, Write&quit

(6) Can reboot machine Verify that the configuration is successful

(7) Restart command: Reboot or init 6

After you reboot, you can see that you have changed

Format of the command line

Current logged-on user @ host name "Current path location"

For example: HADOOP@HADOOP01 ~

3. Network mapping (domain name and IP mapping)

Format: IP host name

Both Linux and Windows need to set

Windows configuration file path: C:\Windows\System32\drivers\etc\hosts file

Linux configuration file path:/etc/hosts192.168.237.128 hadoop01.hh.com

4, set DNS domain name resolution (resolve unable to connect to the extranet)

We ping www.baidu.com The bottom is also ping Baidu's IP, there is a process of parsing, this is the DNS server completed, general DNS settings for their own gateway IP address on it

Our gateway is 192.168.237.2.

Set up DNS resolution in the configuration file of the network adapter Vi/etc/sysconfig/network-scripts/ifcfg-eth0

dns1=114.114.114.114

Restart Network: Service network restart, effective

Related Article

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.