配置主机IP
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none" //获取地址方式,none-手动配置,dhcp-自动获取
DEFROUTE="yes"
IPADDR=10.0.122.108 //本机IP地址
GATEWAY=10.0.122.1 //网关
DNS1=114.114.114.114 //DNS域名解析服务器
PEEDRNS=YES //启用上面的DNS,否则编写/etc/sys
PREFIX=24
IPV4_FAILURE_FATAL="no"
NAME="ens33"
UUID="e3487562-aae0-49ee-a7cd-05bcbb1e3ff8"
DEVICE="ens33"
ONBOOT="yes"
刷新
[root@localhost ~]# systemctl restart network.service
查看自己的ip有没有配置成功
ip address
ping百度可以成功,即可
ping www.baidu.com
配置主机名
hostnamectl set-hostname newname
主机名解析
vim /etc/host
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
ip地址 name1,name2,name3
ping name1/2/3 都是ping 那个ip
SSH和SSHD
系统的密钥对位置
/etc/ssh/sshd_conf
use_DNS=no
GSSA =no //加速连接
port=2222
-p指定端口
ssh -p 2222
ssh-copy-ip -p 2222
scp -P 2222 源文件 目标文件
本地传输到远端
scp filename 用户@ip:/PATH/TO/remotefile.txt
远端下载到本地
scp 用户@ip:/PATH/TO/remotefile.txt filename
ss -natl----查看运行的端口
[root@huangstts ~]# ss -natl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:111 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 5 192.168.122.1:53 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 128 127.0.0.1:631 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 127.0.0.1:6011 *:*
LISTEN 0 80 :::3306 :::*
LISTEN 0 128 :::111 :::*
LISTEN 0 32 :::21 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 128 ::1:631 :::*
LISTEN 0 100 ::1:25 :::*
LISTEN 0 128 ::1:6011 :::*
http相关知识
文档:http相关知识.md
链接:http://note.youdao.com/noteshare?id=3e32e00d5d9f57f4d187e4a76243dfde
ip address----查看ip
ip route----查看路由表
配置静态路由
ip route add default via 10.1.122.1