Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux virtual machine settings network, hostname ssh access     - Tomcat itself through simple movement separation (Server)

- Configure the Linux kernel and use iptables to do port mapping (Linux)

- Git Rebase Tutorial: Using Git Rebase turn back the clock (Linux)

- Netcat Example (Linux)

- Linux system commands to view hardware information (Linux)

- Red-black tree in C ++ (Programming)

- MySQL and MariaDB new master from the cluster configuration GTID (Database)

- MySQL completely uninstall and install Configuring Character Sets under Linux (Database)

- Install Linux Mint 17: 20 things to do (Linux)

- Linux / Raspberry Pi using the following command-line based web browser (Linux)

- Ubuntu cut screen method (Linux)

- To teach you a trick to find the real IP address (Linux)

- Ubuntu ADSL dial-up Internet access (Linux)

- MySQL to recover the data through binlog (Database)

- Linux Proc File System Experiment (Linux)

- GRUB2 boot Ubuntu Manual (Linux)

- Binary tree and some basic operations with binary list (Programming)

- Java polymorphic methods inside constructors complete analysis (Programming)

- Migu online music player for Linux (Linux)

- Editor of the popular Linux Gvim (Linux)

 
         
  Linux virtual machine settings network, hostname ssh access
     
  Add Date : 2017-01-08      
         
         
         
  Installation ready virtual machine, you need to set up external network access to ssh remote access control has been through the host names.

1, set the hostname on Linux, to access the linux virtual machine by hostname
1.1 Modifying the hosts file
vim / etc / hosts

# / Etc / hosts generally have content similar to the following contents:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.136.128 Oracle_master

Save and exit.

1.2 Modify network
You can directly modify the configuration file / etc / sysconfig / network
There is a HOSTNAME = yourname
Modified directly out of it.
NETWORKING = yes
HOSTNAME = oracle_master

1.3. Manually set hostname
hostname oracle_master
PS: If the above three steps are done, but found hostname did not change over a few went to see the following document, whether it is before the hostname value

[Root @ oraclem1 ~] # vim / etc / sysconfig / network
[Root @ oraclem1 ~] # find / -name hostname
/ Proc / sys / kernel / hostname
/ Bin / hostname
/ Usr / lib64 / gettext / hostname
[Root @ oraclem1 ~] # vim / proc / sys / kernel / hostname
oraclem1

See previous old value here can not be modified because of the read-only, you need to reboot the server to take effect after reboot, hostname becomes a new oracle_master.

1.4, the linux ip local settings and hostname mapping
[Root @ oracle_master ~] # vim / etc / hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 oracle_master
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.136.128 oracle_master
192.168.136.129 oracle_standby

So directly through ssh hostname can remotely log on, as follows:

[Root @ oracle_master ~] # ssh oracle_standby
Last login: Thu Oct 22 05:58:40 2015 from 192.168.136.128
[Root @ oracle_standby ~] #

1.5, windows set above the local map
In the C: \ Windows \ System32 \ drivers \ etc \ hosts added
192.168.136.128 oracle_master

It can then direct ping hostname ping pass, as follows:
C: \ Users \ Administrator> ping oracle_master

Is Ping oracle_master [192.168.136.128] with 32 bytes of data:
Reply from 192.168.136.128: Byte = 32 time <1ms TTL = 64
Reply from 192.168.136.128: Byte = 32 time <1ms TTL = 64
Reply from 192.168.136.128: Byte = 32 time <1ms TTL = 64
Reply from 192.168.136.128: Byte = 32 time <1ms TTL = 64

192.168.136.128 The Ping statistics:
Packet: Sent = 4, Received = 4, Lost = 0 (0% loss),
The estimated round-trip travel time (in milliseconds):
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C: \ Users \ Administrator>

2, set up the network address on linux
2.1 set ip address in eth0
[Root @ oracle_master ~] # vim / etc / sysconfig / network-scripts / ifcfg-eth0

DEVICE = eth0
BOOTPROTO = none
HWADDR = 00: 0C: 29: 0A: 79: E6
IPV6INIT = yes
NM_CONTROLLED = yes
ONBOOT = yes
IPADDR = 192.168.136.128
NETMASK = 255.255.255.0
TYPE = Ethernet
GATEWAY = 192.168.136.2
USERCTL = no

After configuration, reboot

Wherein here gateway is obtained from the following way in VMware Workstation top bar, select "Edit" and then select "Virtual Network Editor (N)", then select "VMnet8", then select "NAT Settings (S) ... ", there is a" gateway IP (G): "behind the show is the gateway value, as shown below:
Write image description here
C: \ Users \ Administrator \ Pictures \ 1022 \ 1.png

Wherein here HWADDR is obtained from the following ways, the choice of "oracle_master" virtual machine on the right, after the right-click to select "Settings (S)", then select "Network Adapters" and select the "Advanced (V) ..." , you can see the MAC address (M). As shown below:
Write image description here
C: \ Users \ Administrator \ Pictures \ 1022 \ 2.png

2.2 Setting the DNS configuration file, so that you can go on the way domain extranet
nameserver can be set to cost pc computer dns name server ip address, you can also set up a virtual machine's gateway address, set the gateway address here:

[Root @ oracle_standby ~] # vim /etc/resolv.conf

# Generated by NetworkManager
nameserver 192.168.136.2 Testing extranet

[Root @ oracle_standby ~] # ping www.baidu.com
PING www.a.linuxidc.com (115.239.210.27) 56 (84) bytes of data.
64 bytes from 115.239.210.27: icmp_seq = 1 ttl = 128 time = 89.6 ms
64 bytes from 115.239.210.27: icmp_seq = 2 ttl = 128 time = 312 ms
^ C
--- Www.a.linuxidc.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1462ms
rtt min / avg / max / mdev = 89.618 / 200.892 / 312.166 / 111.274 ms
[Root @ oracle_standby ~] # 4, comes with finishing some DNS basics
/etc/resolv.conf
File functions: DNS client configuration file, set the DNS server IP addresses and DNS domain names
Relevant documents: /etc/host.conf
file format:
domainname Domain
search domain
nameserver Primary_DNS_Server_IP_address
nameserver Second_DNS_Server_IP_address

This document is a resolver (resolver, according to a host name to resolve the IP address of the library) using the configuration file, for example:
search oracledg.com
nameserver 192.168.136.1
nameserver 192.168.136.2
"Search domainname.com" means that when an offer does not include the complete domain host name, the host name after adding domainname.com suffix; "nameserver" indicates the address used to resolve domain name server for the specified host. The order in which the domain name server is a file that appears to queries.
Where domainname and search may be present, but also can have only one; nameserver can specify more
Example file content:
search oracledg.com
nameserver 192.168.136.3
     
         
         
         
  More:      
 
- Linux System shutdown procedures (Linux)
- MySQL dual master configuration (Database)
- Linux System Getting Started Learning: Join cron job in Linux (Linux)
- Oracle Character Set Summary (Database)
- Java 8 Lambda principle analysis (Programming)
- How to Install Winusb in Ubuntu 14.04 (Linux)
- Ubuntu rights management common commands (Linux)
- Docker deployment practices in Ubuntu (Server)
- MySQL import large amounts of data (Database)
- Debian (Wheezy) were installed wxPython GUI development (Linux)
- Linux Study of --CentOS create local yum repository (Linux)
- DRBD + Heartbeat solve NFS single point of failure (Server)
- Linux reserves the rest of the file to delete several (Linux)
- Analysis RabbitMQ cluster (Server)
- Ubuntu 15.04 / 14.04 install Ubuntu After Install 2.6 (Linux)
- SSH security note (Linux)
- Linux Security Module (LSM) Introduction (Linux)
- KVM QEMU virtual machine installation configuration under CentOS (Linux)
- Strategy Games Ubuntu installation of Wesnoth 1.12.1 (Linux)
- How to install Git client in Ubuntu (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.