linux常用命令——网络管理篇

2023-03-28 · 未分类 · 1 min


systemctl restart network   # 重启网卡,当更新网卡配置时需要
ifconfig | less # 查看网络配置信息,当网卡较多的时候 加上 less 是比较有用的
ifconfig eth0 up    # 启用 eth0
ifconfig eth0 down  # 关闭 eth0
ifconfig eth0 add 192.168.1.2 netmask 255.255.255.0 # 给 eth0 设置 IP地址,推荐直接修改配置文件 /etc/sysconfig/network-script/ 
route add default gw 192.168.1.1    # 设置默认网关



留言

© 2026 拾光博客. All Rights Reserved. / RSS / Sitemap
Powered by Typecho & Mizuki UI