Linux网络管理

1、网络基本概念
网卡/IP地址/端口/NAT/IPV4/IPV6
2、网络配置文件
/etc/sysconfig/network-scripts/ifcfg-
ens33
网卡配置文件
/etc/sysconfig/network-scripts/ifcfg-lo
环回地址配置文件
/etc/hosts
主机名与IP的映射
/etc/resolv.conf
DNS配置,由ens33自动覆盖
3、查看及配置网络
全拼:network i nter f aces config uring
位于net-tools工具包
可以动态配置网络参数
其他选项参数:https://www.linuxcool.com/
4、连通性探测
PING/TELNET
5、查看网络连接
全拼:network statistics
查看程序的网络连接情况:
netstat -ap | grep ssh
查看端口的网络连接情况:
netstat -ap | grep 3306
6、域名相关
nslookup
nslookup baidu.com
A记录:IP地址
CNAME:域名别名
MX:邮件服务器
dig(domain information groper)
dig baidu.com
dig www.xtu.edu.cn A +noall +answer
dig www.xtu.edu.cn MX +noall +answer
dig www.xtu.edu.cn NS +noall +answer
host
host baidu.com
host -t MX www.baidu.com
7、下载传输
Xshell拖曳——上传
xftp——双向,或者Filezilla、FlashFTP
sz file name——下载
rz——上传
vmtools拖动——传入
QQ——双向
wget https://download.redis.io/releases/redis-6.0.9.tar.gz
wget -O redis.tar.gz https://download.redis.io/releases/redis-6.0.9.tar.gz
wget -c 断点续传
wget -b 后台下载
wget -i filelist.txt 同时下载多个
tail -f wget-log 查看下载进度
全拼:Client URL
curl https://www.baidu.com > page.html
curl -X POST -d 'a=1&b=nihao' URL
curl -H "Content-Type: application/json" -X POST -d '{"abc":123,"bcd":"nihao"}
8.防火墙设置
iptables工具
查看已开放的端口
firewall-cmd --list-ports
开启80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
重启防火墙
firewall-cmd --reload
停止防火墙
systemctl stop firewalld.service
禁止防火墙开机启动
systemctl disable firewalld.service
删除规则
firewall-cmd --zone=public --remove-port=80/tcp --permanent
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值