Linux 下网络命令总结1

在使用Linux 操作系统的时候,会经常的用到网络的命令,现在总结一下:

1,ip addr show :查看网卡和ip地址等信息

2,ip link show :查看网卡信息

3, RX 为下行流量 TX为上行流量 

4,nmcli 这个命令是可以灵活的配置网络的命令,Linux下例子很多,这里举几个小的例子

(1)nmcli device connect eno16777736 启动网卡

(2)nmcli device disconnect eno16777736 关闭网卡

(3)nmcli connection 和 nmcli device 有不同 connection 是连接名 而nmcli device 是设备名

(4)创建一个连接

nmcli connection add con-name "en1" ifname eno16777736  type ethernet ip4 192.168.44.242 gw4 192.168.44.2

 nmcli connection modify "static" ipv4.dns 192.168.44.2

nmcli connection up

(5)配置team口

nmcli con add type team con-name team1 ifname team1 config '{"runner": {"name": "activebackup"}}'

nmcli con mod team1 ipv4.addresses '172.16.3.25/24'

nmcli con mod team1 ipv4. method manual
nmcli con add type team-slave con-name team1-port1 ifname eth1 master team1
nmcli con add type team-slave con-name team1-port2 ifname eth2 master team1
nmcli con show
 

5,ethtool 是用于查询及设置网卡参数的命令

例:ethtool eth1 查看网卡eth1的信息


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值