精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux中ifconfig命令的詳細(xì)解釋

      linux中ifconfig命令的詳細(xì)解釋

      時間: 佳洲1085 分享

      linux中ifconfig命令的詳細(xì)解釋

        linxu下的ifconfig命令是用于查看和配置網(wǎng)絡(luò)設(shè)備的。下面由學(xué)習(xí)啦小編為大家整理了linux的ifconfig命令的詳細(xì)解釋的相關(guān)知識,希望對大家有幫助!

        一、linux中的ifconfig命令的詳細(xì)解釋

        (1)用法:

        用法: ifconfig [網(wǎng)絡(luò)設(shè)備] [參數(shù)]

        (2)功能:

        功能: ifconfig命令用來查看和配置網(wǎng)絡(luò)設(shè)備,當(dāng)網(wǎng)絡(luò)環(huán)境發(fā)生改變時可通過此命令對網(wǎng)絡(luò)進(jìn)行相應(yīng)的配置。

        注意: 用ifconfig命令配置的網(wǎng)卡信息,在網(wǎng)卡重啟后機器重啟后,配置就不存在。要想將上述的配置信息永遠(yuǎn)的存在電腦里,那就要修改網(wǎng)卡的配置文件了。

        (3)選項參數(shù):

        1) up        啟動指定網(wǎng)絡(luò)設(shè)備/網(wǎng)卡。

        2) down       關(guān)閉指定網(wǎng)絡(luò)設(shè)備/網(wǎng)卡。該參數(shù)可以有效地阻止通過指定接口的IP信息流,如果想永久地關(guān)閉一個接口,我們還需要從核心路由表中將該接口的路由信息全部刪除。

        3) -a          無論是否激活,顯示所有配置的網(wǎng)絡(luò)接口。

        4) add         給指定網(wǎng)卡配置IPv6地址

        5) del         刪除指定網(wǎng)卡的IPv6地址

        6) arp|-arp       打開或關(guān)閉支持ARP協(xié)議

        7) mtu<字節(jié)數(shù)>    設(shè)置網(wǎng)卡的最大傳輸單元

        8) netmask<子網(wǎng)掩碼> 設(shè)置網(wǎng)卡的子網(wǎng)掩碼

        二、linux中ifconfig命令的詳解實例

        1)[sunjimeng@localhost ~]$ ifconfig

        [sunjimeng@localhost ~]$ ifconfig         //未聯(lián)網(wǎng)時的參數(shù)

        eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

        ether 00:0c:29:4d:a3:cc txqueuelen 1000 (Ethernet)

        RX packets 1914 bytes 174936 (170.8 KiB)

        RX errors 0 dropped 36 overruns 0 frame 0

        TX packets 0 bytes 0 (0.0 B)

        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

        lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

        inet 127.0.0.1 netmask 255.0.0.0

        inet6 ::1 prefixlen 128 scopeid 0x10<host>

        loop txqueuelen 0 (Local Loopback)

        RX packets 3246 bytes 281472 (274.8 KiB)

        RX errors 0 dropped 0 overruns 0 frame 0

        TX packets 3246 bytes 281472 (274.8 KiB)

        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

        [sunjimeng@localhost ~]$ ifconfig //連接到有線網(wǎng)時的參數(shù)

        eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 //mtu表示最大傳輸單元

        inet 192.168.117.128 netmask 255.255.255.0 broadcast 192.168.117.255

        inet6 fe80::20c:29ff:fe4d:a3cc prefixlen 64 scopeid 0x20<link>

        ether 00:0c:29:4d:a3:cc txqueuelen 1000 (Ethernet)

        RX packets 1969 bytes 181974 (177.7 KiB)

        RX errors 0 dropped 36 overruns 0 frame 0

        TX packets 48 bytes 6324 (6.1 KiB)

        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

        lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

        inet 127.0.0.1 netmask 255.0.0.0

        inet6 ::1 prefixlen 128 scopeid 0x10<host>

        loop txqueuelen 0 (Local Loopback)

        RX packets 3590 bytes 310452 (303.1 KiB)

        RX errors 0 dropped 0 overruns 0 frame 0

        TX packets 3590 bytes 310452 (303.1 KiB)

        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

        說明:

        1)etn(Number)指的是網(wǎng)卡,可以看到目前這個網(wǎng)卡的物理地址(MAC地址)是 00:0c:29:4d:a3:cc。

        2)inet后表示ip地址,此網(wǎng)卡的ip地址是192.168.117.128,廣播地址是192.168.117.255,掩碼地址為255.255.255.0。

        3)lo是表示主機的回壞地址,這個一般是用來測試一個網(wǎng)絡(luò)程序,但又不想讓局域網(wǎng)或外網(wǎng)的用戶能夠查看,只能在此臺主機上運行和查看所用的網(wǎng)絡(luò)接口。

        比如把 http服務(wù)器指定到回環(huán)地址,在瀏覽器輸入127.0.0.1就能看到你所架WEB網(wǎng)站了。但只是您能看得到,局域網(wǎng)的其它主機或用戶無從知道。

        三、linux中的ifconfig命令的結(jié)果解釋

        一 般來說,直接輸入ifconfig就會列出目前已被啟動的卡,不論這個卡是否有設(shè)置IP,都會被顯示出來。而如果是輸入ifconfig eth0,則會顯示出這個接口的相關(guān)數(shù)據(jù),而不管該接口是否啟動。所以,如果你想要知道某個網(wǎng)卡的Hardware Address,直接輸入“ifconfig"網(wǎng)絡(luò)接口代號"”即可。至于上述代碼中出現(xiàn)的各項數(shù)據(jù)是這樣的(數(shù)據(jù)排列由上而下、由左而右)。

        -----------------------------------------------

        eth0 Link encap:以太網(wǎng) 硬件地址 00:0b:db:4c:e4:b3

        inet 地址:172.16.55.25 廣播:172.16.55.255 掩碼:255.255.255.0

        inet6 地址: fe80::20b:dbff:fe4c:e4b3/64 Scope:Link

        UP BROADCAST RUNNING MULTICAST MTU:1500 躍點數(shù):1

        接收數(shù)據(jù)包:8735 錯誤:0 丟棄:0 過載:0 幀數(shù):0

        發(fā)送數(shù)據(jù)包:5234 錯誤:0 丟棄:0 過載:0 載波:0

        碰撞:0 發(fā)送隊列長度:100

        接收字節(jié):3897818 (3.7 MB) 發(fā)送字節(jié):1225779 (1.1 MB)

        基本地址:0xecc0 Memory:ff8e0000-ff900000

        lo Link encap:本地環(huán)回

        inet 地址:127.0.0.1 掩碼:255.0.0.0

        inet6 地址: ::1/128 Scope:Host

        UP LOOPBACK RUNNING MTU:16436 躍點數(shù):1

        接收數(shù)據(jù)包:2063 錯誤:0 丟棄:0 過載:0 幀數(shù):0

        發(fā)送數(shù)據(jù)包:2063 錯誤:0 丟棄:0 過載:0 載波:0

        碰撞:0 發(fā)送隊列長度:0

        接收字節(jié):105049 (102.5 KB) 發(fā)送字節(jié):105049 (102.5 KB)

      3635354