国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

iproute2 ip 命令常用備忘

2019-07-20 00:43:55 9131

ip地址管理    1.顯示ip地址        ip a        ip address show        ip addr show dev eth0        ip a sh eth0    2.增加刪除地址        ip address add 192.0.2.1/24 dev eth0        ip addr del 192.0.2.2/24 dev eth0    3.顯示接口統(tǒng)計        ip -s link ls eth0 網(wǎng)卡和鏈路配置    4.顯示鏈路        ip link show        ip link sh eth0    4.修改接口狀態(tài)        ip link set eth0 up        ip link s gre01 down 路由表管理    5.顯示路由表        ip route        ip ro show dev gre01    6.增加新路由        ip route add 10.2.2.128/27 dev gre01    7.增加默認(rèn)路由        ip route add default via 192.168.1.1    8.修改默認(rèn)路由        ip route chg default via 192.168.1.2    9.刪除默認(rèn)路由        ip route del default隧道配置    10.增加刪除GRE隧道        ip tunnel add gre01 mode gre local 10.1.1.1 remote 20.2.2.1 ttl 255        ip tunnel del gre01    11.IPIP隧道        ip tunl a ipip01 mode ipip local 10.1.1.1 remote 20.2.2.1 ttl 255    12.顯示隧道        ip tunnel show    13.顯示隧道統(tǒng)計        ip -s tunl ls gre01 鄰居和arp表管理    13.查看arp表        ip neigh show    14.手工增加刪除arp項(xiàng)        ip neighbor add 10.2.2.2 dev eth0        ip neigh del 10.2.2.1 dev eth0 socket統(tǒng)計    15.顯示當(dāng)前監(jiān)聽        ss -l    15.顯示當(dāng)前監(jiān)聽的進(jìn)程        ss -p #常用命令    ip link show                             #顯示鏈路    ip addr show                             #顯示地址(或ifconfig)    ip route show                            #顯示路由(route -n)    ip neigh show                            #顯示arp表(ping 192.168.95.50,如果主機(jī)在同一局域網(wǎng)內(nèi),直接加到arp表)    ip neigh delete 192.168.95.50 dev eth0   #刪除arp條目,條目仍然存在狀態(tài)為stale,下次通信需要確認(rèn)    ip rule show                             #顯示缺省規(guī)則    ip route del default dev eth0            #刪除接口路由    ip route show table local                #查看本地靜態(tài)路由    ip route show table main                 #查看直連路由 #添加靜態(tài)路由    ip route add 10.0.0.0/24 via 192.168.92.129    ip route add 10.10.10.10 via 192.168.92.129        ip route add 172.31.100.0/24 dev eno16777736    ip route add 172.32.0.2 dev eno16777736 #查看路由表    [root@localhost ~]# ip route show table main#刪除    ip route del 10.0.0.0/24    ip route del 10.10.10.10        ip route del 172.31.100.0/24    ip route del 172.32.0.2#再次查看路由表    [root@localhost ~]# ip route show table main    [root@localhost ~]# ip route show table local#添加網(wǎng)卡別名    ip addr add 192.168.0.11/24 dev eno16777736 #查看下網(wǎng)卡,別名沒有產(chǎn)生,而是直接繼承    [root@localhost ~]# ip addr show eno16777736       #添加網(wǎng)卡別名并添加標(biāo)記    label    ip addr add 192.168.1.2 label eno16777736:0 dev eno16777736 #查看下,多了eno16777736:0    ip addr show eno16777736        [root@localhost ~]# ip addr add 192.168.55.191/24 label eth0:1 dev eth0    [root@localhost ~]# ip addr show

提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問題: