Cloud Computing Learning Route course syllabus Courseware: tCentos6 Network Card problem
Cloud Computing Learning Route course syllabus Courseware: tCentos6 Network Card problem:
Login history information
[root@robin ~] # last
[root@robin ~] # lastlog
[root@robin ~] # whoami current user identity
Root
[root@robin ~] # who i am original login user identity
Root pts/0 2015-12-02 14:56
Key login
[root@robin ~] # ssh-keygen generates key
[root@robin ~] # ls / root/.ssh/
Id_rsa id_rsa.pub known_hosts
Private key and public key record host information
[root@robin] # ssh-copy-id-I 172.16.110.20 or
[root@robin ~] # scp / root/.ssh/id_rsa.pub 172.16.110.20:/root/.ssh/authorized_keys
Prohibit password login
[root@robin ~] # vim / etc/ssh/sshd_config
PasswordAuthentication no
Log in
[root@robin ~] # ssh root@192.168.10.120
[root@robin ~] # ssh zhb@192.168.10.120
Remote copy
[root@test tmp] # scp / tmp/aa.txt 172.16.110.1:/tmp/
[root@robin ~] # scp / root/install.log 172.16.110.30:/tmp/
[root@robin ~] # scp 172.16.110.30:/tmp/aa.txt 172.16.110.40:/tmp/
Execute command remotely
[root@robin ~] # ssh 172.16.110.30 ls / root/
[root@robin ~] # ssh 172.16.110.30 useradd robin
Configuration file:
# vim / etc/sysconfig/network-s/ifcfg-eth0
DEVICE=eth0 device name
[NAME= "System eth0" device name] may not exist
BOOTPROTO=none Startup Protocol how to obtain ip address static, none = = > static access to dhcp dynamic
NM_CONTROLLED=no defaults to yes to turn off network-manager
ONBOOT=yes boot up
TYPE=Ethernet Ethernet Typ
HWADDR=00:0c:29:8e:a5:d3 mac address
IPADDR=172.16.80.252 ip address
NETMASK=255.255.0.0 mask
PREFIX = 24
NETWORK=172.16.0.0
GATEWAY=172.16.80.1 Gateway
Dns domain name server domain name resolution
Help documentation:
# vim / usr/share/doc/inits-9.03.38/sysconfig.txt
Gateway: the level (exit) of the network, which is generally set to the router
IP forwarding:
Temporary
Echo 1 > / proc/sys/net/ipv4/ip_forward
Permanent
Vim / etc/sysctl.conf modifies kernel parameters
Net.ipv4.ip_forward = 1
Sysctl-p / / effective immediately
Dns: domain name server, one of which is to resolve domain names to Ip addresses
Dns profile (client)
# vim / etc/resolv.conf
Nameserver 172.16.70.250
View mac
# arping 172.16.70.250
Scan ip
# nmap-v-sP 172.16.70.0Unix 24
Scan port
# nmap-v-A 172.16.70.0Univer 24
Restart the network service:
# systemctl restart network / / rhel7
# / etc/init.d/network restart / / rhel5/6
# service network restart / / rhel5/6
Set up a temporary default gateway:
Route Party # route add default gw 172.16.70.1 add default Gateway
Route del default gw 172.16.70.1 Delete default Gateway (rhel5/6) route add default gw 172.16.70.1 add default Gateway route del default gw 172.16.70.1 Delete default Gateway route-n View routing table full digital display
Add a static route:
Route add-net 10.18.45.0 natmask 255.255.255.0 gw 10.18.44.1
Delete a static route:
Route del-net 10.18.45.0 natmask 255.255.255.0 gw 10.18.44.1
Destination Gateway Genmask Flags Metric Ref Use Iface
Destination network gateway
Ip mode (rhel7)
Ip route (r) [list (l)]
Delete default route / gateway
Ip r d default
Delete static rout
Ip r d 10.18.40.0/24
Add default Gateway
Ip r a default via 10.18.44.1 dev (device) enp0s25 routing
Ip r a 10.18.45.0/24 via 10.18.44.1 dev enp0s25