欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

linux網(wǎng)絡(luò)管理及屬性命令-創(chuàng)新互聯(lián)

一.Linux網(wǎng)絡(luò)管理命令

成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比旌陽網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式旌陽網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務覆蓋旌陽地區(qū)。費用合理售后完善,十多年實體公司更值得信賴。

1.Ifconfig命令

 ifconfig顯示當前網(wǎng)絡(luò)信息

 格式: ifconfig  [INTERFACE]

 常用選項:

      -a:查看所有信息

      ifconfig IFACE up|down  啟用|禁用某網(wǎng)卡接口

ifconfig interface [aftype] options | address ...

       # ifconfig IFACE IP/mask [up]

       # ifconfig IFACE IP netmask MASK

啟用混雜模式:[-]promisc

Note:啟用后立即生效。再次開機后不會再生效!

Eg:禁用eth2接口

[root@localhost ~]# ifconfig eth2 down
[root@localhost ~]# ifconfig      //可以看到eth2已經(jīng)不再顯示了
eth0      Link encap:Ethernet  HWaddr 00:0C:29:7B:65:71  
          inet addr:172.16.249.202  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: fe80::20c:29ff:fe7b:6571/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:159414 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4673 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12952278 (12.3 MiB)  TX bytes:666573 (650.9 KiB)
 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

2.Route命令

     常用選項:

     -n: 查看路由表信息

     格式: route  add|del  [-net|-host] target [netmask Nm] [gw Gw]  [[dev] If]

     add | del

        -net: 添加|刪除一個網(wǎng)絡(luò)路由(即添加網(wǎng)段)

        -host: 添加|刪除一個主機路由

        -gw : 添加| 刪除網(wǎng)關(guān)

        -netmask:添加|刪除子網(wǎng)掩碼

        default:添加|刪除 默認路由

Eg1:給eth0添加一個主機路由為192.168.1.3,默認網(wǎng)關(guān)為172.16.0.1

[root@localhost ~]# route add -host 192.168.1.3 gw 172.16.0.1 dev eth0
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.3     172.16.0.1      255.255.255.255 UGH   0      0        0 eth0
192.168.27.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth2
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
刪除192.168.1.3這個路由
[root@localhost ~]# route del -host 192.168.1.3 
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.27.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth2
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
[root@localhost ~]# 
刪除此路由條目
[root@localhost ~]# route del -net  192.168.0.0/24
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.27.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth2
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
或者[root@localhost ~]# route del -net  192.168.0.0 netmask 255.255.255.0 
Eg2:給eth0接口添加一個網(wǎng)絡(luò)路由為192.168.0.0默認網(wǎng)關(guān)為 172.16.0.1
[root@localhost ~]# route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 dev eth0
[root@localhost ~]# route add -net 192.168.0.0/24  gw 172.16.0.1 dev eth0

3.Netstat命令

  1>.顯示網(wǎng)絡(luò)連接:

格式: 
netstat  [--tcp|-t] [--udp|-u]  [--raw|-w]  [--listening|-l]  [--all|-a] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--symbolic|-N] [--extend|-e[--extend|-e]]

常用選項:

  -t :tcp協(xié)議相關(guān)

  -u :udp協(xié)議相關(guān)

  -l :監(jiān)聽的套接字     //常跟-t,-u選項

  -p :打印信息

  -e :擴展信息

  -n :以數(shù)字形式顯示

  -p: 顯示相關(guān)pid信息

Eg:以數(shù)字形式顯示當前主機下tcp協(xié)議都監(jiān)聽那些端口并打印出來
[root@chang ~]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1821/sshd           
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1612/cupsd          
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      2181/sshd           
tcp        0      0 0.0.0.0:50982               0.0.0.0:*                   LISTEN      1580/rpc.statd      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1478/rpcbind        
tcp        0      0 :::22                       :::*                        LISTEN      1821/sshd           
tcp        0      0 ::1:631                     :::*                        LISTEN      1612/cupsd          
tcp        0      0 ::1:25                      :::*                        LISTEN      1935/master         
tcp        0      0 :::35321                    :::*                        LISTEN      1580/rpc.statd      
tcp        0      0 ::1:6010                    :::*                        LISTEN      2181/sshd           
tcp        0      0 :::111                      :::*                        LISTEN      1478/rpcbind

2>.顯示路由信息

格式:netstat {--route|-r} [--numeric|-n][--numeric-hosts][--numeric-ports][--numeric-ports]

常用選項:

 -r: 顯示內(nèi)核路由表

 -n: 以數(shù)字格式顯示

   3>.顯示接口統(tǒng)計數(shù)據(jù)

     netstat  {--interfaces|-I|-i} [iface] [-all|-a] [--extend|-e] [--program|-p]

     常用選項:

      -i : 顯示所有的接口信息

      -I IFACE : 顯示多指定的接口信息

二.Linux網(wǎng)絡(luò)屬性命令

1.Ip 命令

格式: ip [ OPTIONS ] OBJECT { COMMAND | help }

 OBJECT := { link | addr | route }

   ip link   - network device configuration

          set DEVICE { up | down } 激活| 禁用某接口

          show DEVICE

          show  up : 僅顯示處于激活狀態(tài)的接口

    ip  address -  protocol address management

       ip addr { add | del } IFADDR dev STRING

           [label LABEL]:添加地址時指明網(wǎng)卡別名

   [scope {global|link|host}]:指明作用域

 global: 全局可用;

     link: 僅鏈接可用;

     host: 本機可用;

         ip address show - look at protocol addresses

[dev DEVICE]

[label PATTERN]

[primary and secondary]

 ip address flush - flush protocol addresses

使用格式同show

     ip route - routing table management

 ip route add

  添加路由:ip route add TARGET via GW dev IFACE src SOURCE_IP

TARGET:

 主機路由:IP

 網(wǎng)絡(luò)路由:NETWORK/MASK

 添加網(wǎng)關(guān):ip route add defalt via GW dev IFACE

 ip route delete

 刪除路由:ip route del TARGET

        ip route show

         ip route flush

     [dev IFACE]

     [via PREFIX]

2.ss命令

   格式: ss [options] [ FILTER ]

   常用選項:

      -t : tcp協(xié)議相關(guān)

      -u : udp協(xié)議相關(guān)

      -w : 顯示裸套接字

      -x  : unix sock 相關(guān)

      -l   : 監(jiān)聽狀態(tài)的連接

      -a  : all

      -n  : 以數(shù)字格式顯示

      -p : 相關(guān)程序及其pid

      -e : extend 的信息

      -m : 內(nèi)存用量

      -o  : 計時器信息

FILTER := [ state TCP-STATE ] [ EXPRESSION ]

EXPRESSION:

   dport =

    sport =

補充: tcp的常見狀態(tài)

   LISTEN  : 監(jiān)聽

   EATABLISHED :已建立的連接

   FIN_WAIT_1

   FIN_WAIT_2

   SYN_SENT

   SYN_RECV

   CLOSE

ss命令跟netstat命令功能相似,但是要當前連接數(shù)較大時用ss命令用著更好。

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

當前題目:linux網(wǎng)絡(luò)管理及屬性命令-創(chuàng)新互聯(lián)
文章分享:http://chinadenli.net/article46/cochhg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)定制開發(fā)網(wǎng)站策劃ChatGPTApp設(shè)計網(wǎng)站設(shè)計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司