Linux [网络配置]

查看接口信息 ifconfig (-a 所有 /  eth0 查看特定网卡)

lo接口:环回接口,操作系统自带

 

打开关闭相应网卡接口 ifup ifdown    (ifup eth0)

 

setup命令配置 (基于命令行的文本界面),想windows配置一样,填空   (redhat only? my ubuntu don‘t have use sysv-rc-conf,sudo apt-get install sysv-rc-conf to install)

 

配置文件

网卡(eth0):/etc/sysconfig/network-scripts/ifcfg-eth0 (redhat, Fedora)    /etc/network/interfaces (Ubuntu, like other Debian)

DNS:/etc/resolv.conf 

主机名:/etc/sysconfig/network (redhat, Fedora) 

静态主机名:/etc/hosts (redhat, Fedora) 

 

测试网路联通:

ping ...

 

检查DNS:

host www.google.com

dig www.google.com (详细)

 

显示路由表:

ip route

 

跟踪路由:

traceroute www.google.com  (有些router是追踪不到的 ×××)

 

检测网络质量:

mtr www.google.com

 

修改主机名:

临时 hostname myhost

永久 /etc/sysconfig/network   HOSTNAME=myhost (Redhat)    /etc/hostname(Ubuntu)

转载于:https://www.cnblogs.com/ethanchou/p/3865996.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值