linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接
Centos 安装
yum install iproute iproute-doc
- 1
Ubuntu 安装
apt-get install iproute iproute-doc
- 1
风.fox
| 说明 | net-tools | iproute2 |
|---|---|---|
| 邻居 | arp -na arp |
ip neigh |
| 地址和链路配置 | ifconfig | ip link ip addr |
| 显示全部接口信息 显示IP |
ifconfig -a | ip addr show |
| 帮助 | ifconfig –help | ip help |
| 显示摘要信息 | ifconfig -s | ip -s link |
| 启动指定网络设备/网卡 | ifconfig eth0 up | ip link set eth0 up |
| 组播 | ipmaddr | ip maddr |
| ip隧道 | iptunnel | ip tunnel |
| 统计 | netstat | ss |
| 显示网络界面信息表单 | netstat -i | ip -s link |
| 显示多重广播功能群组组员名单 | netstat -g | ip maddr |
| 列出监听服务状态 | netstat -l | ss -l |
| 路由表 | netstat -r route |
ip route |
| 添加路由 | route add | ip route add |
| 删除路由 | route del | ip route del |
| 查看路由状态 | route -n | ip route show |
| 增删VLAN | vconfig | ip link |
显示当前监听端口
ss -pltn
- 1
以下全部是转载
ip地址管理
1.显示ip地址
ip a
ip address show
ip addr show dev eth0
ip a sh eth0
- 1
- 2
- 3
- 4
2.增加删除地址
ip address add 192.0.2.1/24 dev eth0
ip addr del 192.0.2.2/24 dev eth0
- 1
- 2
3.显示接口统计
ip -s link ls eth0
- 1
网卡和链路配置
4.显示链路
ip link show
ip link sh eth0
- 1
- 2
4.修改接口状态
ip link set eth0 up
ip link s gre01 down
- 1
- 2
路由表管理
5.显示路由表
ip route
ip ro show dev gre01
- 1
- 2
6.增加新路由
ip route add 10.2.2.128/27 dev gre01
- 1
7.增加默认路由
ip route add default via 192.168.1.1
- 1
8.修改默认路由
ip route chg default via 192.168.1.2
- 1
9.删除默认路由
ip route del default
- 1
隧道配置
10.增加删除GRE隧道
ip tunnel add gre01 mode gre local 10.1.1.1 remote 20.2.2.1 ttl 255
ip tunnel del gre01
- 1
- 2
11.IPIP隧道
ip tunl a ipip01 mode ipip local 10.1.1.1 remote 20.2.2.1 ttl 255
- 1
12.显示隧道
ip tunnel show
- 1
13.显示隧道统计
ip -s tunl ls gre01
- 1
邻居和arp表管理
13.查看arp表
ip neigh show
- 1
14.手工增加删除arp项
ip neighbor add 10.2.2.2 dev eth0
ip neigh del 10.2.2.1 dev eth0
- 1
- 2
socket统计
15.显示当前监听
ss -l
- 1
15.显示当前监听的进程
ss -p
- 1
查看端口链接
lsof -n -i4TCP:80 | grep LISTEN # Verified on macOS Sierra
lsof -n -iTCP:80 | grep LISTEN
lsof -n -i:80 | grep LISTEN
- 1
- 2
- 3
为了不显示端口的俗称,你可以加P参数:
lsof -nP -i4TCP:$PORT | grep LISTEN # Verified on macOS Sierra
lsof -nP -iTCP:$PORT | grep LISTEN
lsof -nP -i:$PORT | grep LISTEN
- 1
- 2
- 3
来自:
http://www.jianshu.com/p/125fbe9dc1d2
http://blog.csdn.net/kevin3101/article/details/52368860
http://linoxide.com/linux-command/use-ip-command-linux/
http://colobu.com/2017/07/11/show-connections-in-MACOS/
linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接的更多相关文章
- Linux(CentOS)修改IP地址
登陆连接centos系统,输入 ifconfig 可以查看到当前本机的IP地址信息 一 临时修改IP地址: 1.假如查询IP为1.118,输入 ifconfig eth0 (默认是第一个网卡) 后面接 ...
- ubuntu 查本机 ip地址的命令是什么, 详细信息的?
使用ifconfig命令即可.你一敲进去都出来了
- 【liunx】使用xshell连接虚拟机上的CentOS 7,使用xhell连接本地虚拟机上的Ubuntu, 获取本地虚拟机中CentOS 7的IP地址,获取本地虚拟机中Ubuntu 的IP地址,Ubuntu开启22端口
注意,如果想用xshell去连接本地虚拟机中的linux系统,需要本地虚拟机中的系统是启动的才能连接!!!!! ============================================ ...
- Linux系统下如何设置IP地址?
Linux系统下如何设置IP地址?我们可以通过命令设定IP的方法,不过此方法的前提条件是用户需root权限.在linux系统的 /etc/sysconfig/network-script/ifcfg- ...
- ssh远程连接docker中linux(ubuntu/centos)
ssh远程连接docker中linux(ubuntu/centos) https://www.jianshu.com/p/9e4d50ddc57e centos docker pull centos: ...
- Ubuntu配置和修改IP地址
Ubuntu配置和修改IP地址 1.修改配置文件/etc/network/interfacesroot@ubuntu:~# sudo gedit /etc/network/interfaces 添加以 ...
- Linux环境下如何配置IP地址、MAC地址
Linux环境下如何配置IP地址.MAC地址 1.配置IP地址 进入配置IP地址路径,进行修改即可 cd /etc/network vim interface 加入以下内容: iface eth0 i ...
- Linux下获取本机IP地址的代码
Linux下获取本机IP地址的代码,返回值即为互联网标准点分格式的字符串. #define ETH_NAME "eth0" //获得本机IP地址 char* GetLocalAdd ...
- CentOS 修改固定IP地址
CentOS 修改固定IP地址 参考地址:https://www.cnblogs.com/technology-huangyan/p/9146699.htmlhttps://blog.csdn.net ...
随机推荐
- 4、html的body内标签之input系列
一.input标签与form表单 <!DOCTYPE html> <html lang="en"> <head> <meta charse ...
- E20180403-hm
accompany vt. 陪伴,陪同; 附加,补充; 与…共存; 为…伴奏 synchronous adj. 同时存在[发生]的,同步的 asynchronous adj. 异步的; particu ...
- bzoj 4199: [Noi2015]品酒大会【后缀数组+单调栈+并查集】
用SA求出height数组,然后发现每个height值都有一个贡献区间(因为点对之间要依次取min) 用单调栈处理出区间,第一问就做完了 然后用并查集维护每个点的贡献(?),从大到小枚举height, ...
- 【原创】《从0开始学Elasticsearch》—document的单/批量crud
内容目录 1.新建文档2.查询文档3.修改文档4.删除文档 1.新建文档 1). 语法1,手动指定document 的id: PUT /index_name/type_name/id{ &quo ...
- wamp2.5版本配置多端口虚拟主机
1.保证httpd.conf下 LoadModule php5_module "D:/E/php/wamp/bin/php/php5.5.12/php5apache2_4.dll" ...
- The Specials Menu LightOJ - 1025
The Specials Menu LightOJ - 1025 题意:在给定的字符串中删去一些字符,使其成为回文串(不能全部都删).求方案数. 方法:常规的区间dp.ans[i][j]表示在i到j的 ...
- 18.3.2从Class上获取信息(注解)
package d18_3_1; /** * Class类上所包含的注解 * * getAnnotation(Class annotationClass) 获取该元素上指定的类型的注解 * getAn ...
- CentOS 7.2安装pip
CentOS 7.2默认安装的python版本为python2.7.5,我的系统里面默认是没有安装pip 的,搜了下网上各路大侠的解决办法,如下: 使用yum安装python-pip,但是报错,说没有 ...
- ref 和 React.js 中的 DOM 操作
在 React.js 当中你基本不需要和 DOM 直接打交道.React.js 提供了一系列的 on*方法帮助我们进行事件监听,所以 React.js 当中不需要直接调用 addEventListen ...
- P2658 汽车拉力比赛
题目描述 博艾市将要举行一场汽车拉力比赛. 赛场凹凸不平,所以被描述为M*N的网格来表示海拔高度(1≤ M,N ≤500),每个单元格的海拔范围在0到10^9之间. 其中一些单元格被定义为路标.组织者 ...