2019年10月18日 星期五

iproute2

傳統上 Linux 使用 net-tools 工具程式 arp、ifconfig、和 route 來設定或查看網路,但這些功能有所限制。Linux kernel 2.2 之後使用重新設計的網路子系統,也需要新的工具程式。

iproute2 是 Linux 上管理 TCP/IP 網路的一套工具程式,包括網路界面、routing、tunnels、traffic control、和網路相關 device drivers,通常以套件 iproute 或 iproute2 發行。iproute2 工具程式使用 netlink 協定跟 Linux kernel 溝通。

net-toolsiproute2說明
ifconfig if[:n] ip[/len| netmask nm]ip addr add ip[/len] dev if界面 if 設定或新增 (有 :n) IPv4 位址 ip。netmask nmnm 需轉換成 prefix 長度 len
ifconfig if add ip/len界面 if 新增 IPv6 位址 ip,prefix 長度為 len
ifconfigip addr, ip link, ip -s其它 Address and link 設定
routeip routeRouting tables
arpip neighNeighbors
iptunnelip tunnelTunnels
nameififrename, ip link set name網路界面改名
ipmaddrip maddr群播
netstatip -s, ss, ip route顯示網路統計

除了 ip 指令,還有 ss, bridge, rtacct, rtmon, tc, ctstat, lnstat, nstat, routef, routel, rtstat, tipc, arpd 和 devlink。

參考
  1. https://en.wikipedia.org/wiki/Iproute2 
  2. https://wiki.linuxfoundation.org/networking/iproute2
  3. https://lartc.org/howto

沒有留言:

張貼留言

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...