没有合适的资源?快使用搜索试试~ 我知道了~
首页Linux 下常用的网络配置命令
Linux 下常用的网络配置命令
需积分: 10 119 浏览量
更新于2023-05-25
评论
收藏 26KB DOC 举报
Linux 下常用的网络配置命令 . ifconfig 可以使用ifconfig 命令来配置并查看网络接口的配置情况。
资源详情
资源评论
资源推荐

Linux 下常用的网络配置命令
. ifcong
可以使用 ifcong 命令来配置并查看网络接口的配置情况。
例如:
(1) 配置 eth0 的 IP 地址,同时激活该设备。
#ifcong eth0 192.168.1.10 netmask 255.255.255.0 up
(2) 配置 eth0 别名设备 eth0:1 的 IP 地址,并添加路由。
#ifcong eth0 192.168.1.3
#route add –host 192.168.1.3 dev eth0:1
(3) 激活设备。
#ifcong eth0 up
(4) 禁用设备。
#ifcong eth0 down
(5) 查看指定的网络接口的配置。
#ifcong eth0
(6) 查看所有的网络接口配置。
#ifcong
2. route
可以使用 route 命令来配置并查看内核路由表的配置情况。
例如:
(1) 添加到主机的路由。
#route add –host 192.168.1.2 dev eth0:0
#route add –host 10.20.30.148 gw 10.20.30.4
(2) 添加到网络的路由。
#route add –net 10.20.30.40 netmask 255.255.255.248 eth0
#route add –net 10.20.30.48 netmask 255.255.255.248 gw
10.20.30.41
#route add –net 192.168.1.0/24 eth1
(3) 添加默认网关。
#route add default gw 192.168.1.1
1


















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0