当前位置: 首页 > web >正文

【Linux 网络】网络工具ifconfig和iproute/iproute2工具详解

【Linux 网络】网络工具ifconfig和iproute/iproute2工具详解

  • 前言
  • 1、安装
  • 2、常用命令
  • 3、命令使用详解

前言

本篇文章主要介绍Linux下网络工具ifconfig/iproute(iproute2)的安装、使用示例和场景。操作系统Ubuntu 18.04。

1、安装

使用apt-get install 命令安装ifconfig和iproute工具,我这里显示已安装,sudo提升管理员权限必不可少。

# 安装net-tools才能使用ifconfig命令
root@root:~$ sudo apt-get install net-tools 
[sudo] password for lijiangtao: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
net-tools is already the newest version (1.60+git20161116.90da8a0-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
lijiangtao@lijiangtao:~$ # 安装iproute工具才能使用ip命令
root@root:~$ sudo apt-get install iproute2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
iproute2 is already the newest version (4.15.0-2ubuntu1.3).
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
lijiangtao@lijiangtao:~$ 

2、常用命令

这里添加一个功能命令对照表,便于读者按图索骥。并在下一章节的小节中查看详细使用说明。

功能nettoolsiproute
@3.1 查看指定/所有网络接口ifconfig /ifconfig eth0/ifconfig -aip link show/ip link show eth0
@3.2 启用/禁用网络接口ifconfig eth0 up/ifconfig eth0 downip link set eth0 up/down
@3.2 设置/取消ip地址和掩码ifconfig eth0 192.168.1.1 netmask 255.255.255.0/ifconfig eth0 192.168.100.1 netmask 255.255.255.0 downip addr add 192.168.1.1/24 dev eth0/ip addr delete 192.168.4.1/24 dev eth0
@3.3 设置mac地址ifconfig eth0 hw ether 00:11:22:33:44:55ip link set eth0 address 00:11:22:33:44:55
@3.4 设置最大传输单元MTUifconfig eth0 mtu 1500ip link set eth0 mtu 1500
@3.5 设置/网卡混杂模式ifconfig eth0 promisc/ifconfig eth0 -promiscip link set eth0 promisc on/off

3、命令使用详解

http://www.xdnf.cn/news/3182.html

相关文章:

  • 端到端观测分析:从前端负载均衡到后端服务
  • 进程、线程、进程间通信Unix Domain Sockets (UDS)
  • 《操作系统真象还原》第十一章——用户进程
  • Spring 框架中的常见注解讲解
  • Qt窗口关闭特效:自底而上逐渐消失
  • google colab设置python环境为python3.7
  • 提高程序灵活性和效率的利器:Natasha动态编译库【.Net】
  • 【学习笔记】Shell编程--Bash变量
  • HBuider中Uniapp去除顶部导航栏-小程序、H5、APP适用
  • 线上婚恋相亲小程序源码介绍
  • Learning vtkjs之ImageMarchingSquares
  • 国内免费连接claude-3-7大模型操作教程
  • 数据库系统综合应用与深度实践指南
  • VINS-FUSION:配置参数说明与配置自己的参数
  • 【XR】MR芯片 和 VR芯片之争
  • Linux:文件操作
  • FEKO许可配置
  • C++负载均衡远程调用学习之Reactor事件触发机制
  • Python3(19)数据结构
  • 第 11 届蓝桥杯 C++ 青少组中 / 高级组省赛 2020 年真题
  • 涨薪技术|0到1学会性能测试第43课-apache status模块监控
  • halcon关闭图形窗口
  • 论文阅读:2024 ICML In-Context Unlearning: Language Models as Few-Shot Unlearners
  • Flink之DataStream
  • URP - 公告牌的效果实现
  • Keysight万用表使用指南及基于Python采集数据生成Excel文件
  • Solon Cloud Gateway 补充
  • 配置 Odoo 的 PostgreSQL 数据库以允许远程访问的步骤
  • 远程深度学习新环境配置流程
  • 力扣-数组-41缺失的第一个正数