2 Star 1 Fork 0

zhrun8899 / learning-notes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
linux-IP命令.md 907 Bytes
一键复制 编辑 原始数据 按行查看 历史

CentOS7 之IP命令 分类: Linux ip命令和ifconfig命令一样,但是功能更加强大,并旨在取代后者。CentOS 7中默认使用ip命令,不在安装ifconfig。ifconfig命令属于net-tools套件,而ip命令属于iproute套件。下面来看一下它的用法:

1.设置IP地址——

ip addr add 192.168.1.115/24 dev eth0

2.查看IP地址——

ip addr show eth0

3.删除IP地址——

ip addr del 192.168.1.1 dev eth0

4.查看路由表——

ip route show

5.查看路由包来自的接口(本地接口)——

ip route get 123.125.114.144

6.更改默认路由——

ip route add default via 192.168.1.254

7. 显示网络统计信息——

ip -s link

8.查看ARP条目——

ip neigh(或neighbour)

9.监控netlink消息——

ip monitor all

10.激活网络接口——

ip link set eth0 up

11.停止网络接口——

ip link set eth0 down

1
https://gitee.com/zhrun8899/learning-notes.git
git@gitee.com:zhrun8899/learning-notes.git
zhrun8899
learning-notes
learning-notes
master

搜索帮助