ifconfig-route-netstat

來源:互聯網
上載者:User

標籤:linux

ifconfig命令

ifconfig -a

ifconfig eth0 [up|down]

ifconfig eth0 172.16.6.14/16 [up]

ifconfig eth0 172.16.6.14/16(16為子網路遮罩長度)

ifconfig eth0 172.16.6.14 netmask 255.255.0.0

注意:立即生效。

啟用混雜模式:[-]promisc

route命令

路由管理命令

查看route -n

添加route add 

route add -host 192.168.1.44 gw 172.16.6.1 dev eth0(目標主機路由)

route add -net  192.168.0.0 netmask 255.255.255.0 gw 172.16.6.1 dev eth0

預設路由,網關:

route add -net 0.0.0.0 netmask 0.0.0.0 gw 172.16.6.1

route add default gw 172.16.6.1

route del -host 192.168.1.44

route del -net 192.168.0.0 netmask 255.255.255.0

DNS伺服器指定

/etc/resolv.cnfg

nameserver DNS_IP1

nameserver DNS_IP2

nameserver DNS_IP3

正解: FQDN-->IP

dig -t A FQDN

host -t A FQDN

反解:IP-->FQDN

dig -x IP

host -x IP

netstat:網路狀態查看命令

netstat  - Print network connections, routing tables, interface statis-

       tics, masquerade connections, and multicast memberships

  

顯示網路連接:

netstat -t

netstat -tn

netstat -atn

-t:tcp

-u:udp

-r:raw socket

-l:監聽

-a:所有狀態

-n:以數字格式顯示,不反解

-e:擴充格式的資訊

-p:顯示相關進程pid

常用組合:

-tan,-uan,-tnl ,-unl

顯示路由表

netstat -rn


顯示介面統計資料

netstat -i 

netstat -Ieth0


ifconfig-route-netstat

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.