真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Linux網(wǎng)絡管理工具-創(chuàng)新互聯(lián)

一、ifconfig命令

站在用戶的角度思考問題,與客戶深入溝通,找到正定網(wǎng)站設計與正定網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設計與互聯(lián)網(wǎng)技術結合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設計制作、網(wǎng)站建設、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、主機域名、虛擬空間、企業(yè)郵箱。業(yè)務覆蓋正定地區(qū)。

ifconfig是linux中用于顯示或配置網(wǎng)絡設備(網(wǎng)絡接口卡)的命令,英文全稱是network interfaces configuring

1、ifconfig -a

[root@test1 yum.repos.d]# ifconfig -a

eth0    Link encap:Ethernet  HWaddr 00:0C:29:1F:06:D4

     inet addr:192.168.1.108  Bcast:192.168.1.255  Mask:255.255.255.0

     inet6 addr: fe80::20c:29ff:fe1f:6d4/64 Scope:Link

     UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

     RX packets:227870 errors:0 dropped:0 overruns:0 frame:0

     TX packets:22314 errors:0 dropped:0 overruns:0 carrier:0

     collisions:0 txqueuelen:1000

     RX bytes:29699855 (28.3 MiB)  TX bytes:5637694 (5.3 MiB)

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:184 errors:0 dropped:0 overruns:0 frame:0

     TX packets:184 errors:0 dropped:0 overruns:0 carrier:0

     collisions:0 txqueuelen:0

     RX bytes:12878 (12.5 KiB)  TX bytes:12878 (12.5 KiB)

[root@test1 yum.repos.d]#

通過這個命令可以看到網(wǎng)卡的ip地址和mac地址,還可以看到lo回環(huán)地址。

第一行:連接類型:Ethernet(以太網(wǎng))HWaddr(硬件mac地址)

第二行:網(wǎng)卡的IP地址、子網(wǎng)、掩碼

第三行:UP(代表網(wǎng)卡開啟狀態(tài))RUNNING(代表網(wǎng)卡的網(wǎng)線被接上)MULTICAST(支持組播)MTU:1500(大傳輸單元):1500字節(jié)

第四、五行:接收、發(fā)送數(shù)據(jù)包情況統(tǒng)計

第七行:接收、發(fā)送數(shù)據(jù)字節(jié)數(shù)統(tǒng)計信息。

2、ifconfig interface [up|down]  //啟動接口或禁用接口

3、ifconfig interface IP/mask  //為接口設置ip地址

4、ifconfig interface-alias IP/mask  //為接口別名設置ip地址;立即生效

二、route

查看:route -n

添加:route add

route add  [-net|-host]  target [netmask Nm] [gw Gw] [[dev] If]

目標:192.168.1.3  網(wǎng)關:172.16.0.1

~]# route add -host 192.168.1.3 gw 172.16.0.1 dev eth0

目標:192.168.0.0 網(wǎng)關:172.16.0.1

~]# route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 dev eth0

~]# route add -net 192.168.0.0/24 gw 172.16.0.1 dev eth0

默認路由,網(wǎng)關:172.16.0.1

~]# route add -net 0.0.0.0 netmask 0.0.0.0 gw 172.16.0.1

~]# route add default gw 172.16.0.1

刪除:route del

route del [-net|-host] target [gw Gw] [netmask Nm] [[dev] If]

目標:192.168.1.3  網(wǎng)關:172.16.0.1

~]# route del -host 192.168.1.3

目標:192.168.0.0 網(wǎng)關:172.16.0.1

~]# route del -net 192.168.0.0 netmask 255.255.255.0

三、netstat

netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

顯示網(wǎng)絡連接:

netstat [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [--extend|-e[--extend|-e]]  [--program|-p]

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

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

-w: raw socket相關

-l: 處于監(jiān)聽狀態(tài)

-a: 所有狀態(tài)

-n: 以數(shù)字顯示IP和端口;

-e:擴展格式

-p: 顯示相關進程及PID

常用組合:

-tan, -uan, -tnl, -unl

顯示路由表:

netstat  {--route|-r} [--numeric|-n]

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

-n: 數(shù)字格式

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

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

# netstat -i

# netstat -I IFACE

四、ip

Linux的ip命令和ifconfig類似,但前者功能更強大,并旨在取代后者

ip - show / manipulate routing, devices, policy routing and tunnels

ip [ OPTIONS ] OBJECT { COMMAND | help }

OBJECT := { link | addr | route }

link OBJECT:

ip link - network device configuration

set

dev IFACE

可設置屬性:

up and down:激活或禁用指定接口;

show

[dev IFACE]:指定接口

[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: 本機可用;

[broadcast ADDRESS]:指明廣播地址

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)絡路由:NETWORK/MASK

添加網(wǎng)關: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]

五、ss

ss是Socket Statistics的縮寫。顧名思義,ss命令可以用來獲取socket統(tǒng)計信息,它可以顯示和netstat類似的內(nèi)容。但ss的優(yōu)勢在于它能夠顯示更多更詳細的有關TCP和連接狀態(tài)的信息,而且比netstat更快速更高效。

格式:ss [OPTION]... [FILTER]

選項:

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

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

-w: 裸套接字相關

-x:unix sock相關

-l: listen狀態(tài)的連接

-a: 所有

-n: 數(shù)字格式

-p: 相關的程序及PID

-e: 擴展的信息

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

-o:計時器信息

運行結果一目了然,而且速度很快

[root@test1 yum.repos.d]# ss -tanlp

State    Recv-Q Send-Q                                            Local Address:Port                                             Peer Address:Port

LISTEN    0    128                                                   :::22                                                   :::*    users:(("sshd",1813,4))

LISTEN    0    128                                                   *:22                                                   *:*    users:(("sshd",1813,3))

LISTEN    0    128                                                   :::40470                                                 :::*    users:(("rpc.statd",1635,11))

LISTEN    0    128                                               127.0.0.1:631                                                   *:*    users:(("cupsd",1673,7))

LISTEN    0    128                                                  ::1:631                                                  :::*    users:(("cupsd",1673,6))

LISTEN    0    100                                                  ::1:25                                                   :::*    users:(("master",1990,13))

LISTEN    0    100                                               127.0.0.1:25                                                   *:*    users:(("master",1990,12))

LISTEN    0    128                                                   :::58524                                                 :::*    users:(("rpc.mountd",3684,14))

LISTEN    0    64                                                   :::2049                                                  :::*

LISTEN    0    64                                                    *:2049                                                  *:*

LISTEN    0    128                                                   :::45697                                                 :::*    users:(("rpc.mountd",3684,18))

LISTEN    0    64                                                    *:42242                                                  *:*

LISTEN    0    128                                                   *:44843                                                  *:*    users:(("rpc.mountd",3684,16))

LISTEN    0    128                                                   *:875                                                   *:*    users:(("rpc.rquotad",3679,4))

LISTEN    0    128                                                   *:55244                                                  *:*    users:(("rpc.mountd",3684,8))

LISTEN    0    64                                                   :::59629                                                 :::*

LISTEN    0    128                                                   *:33549                                                  *:*    users:(("rpc.mountd",3684,12))

LISTEN    0    128                                                   *:53679                                                  *:*    users:(("rpc.statd",1635,9))

LISTEN    0    128                                                   :::111                                                  :::*    users:(("rpcbind",1517,11))

LISTEN    0    128                                                   *:111                                                   *:*    users:(("rpcbind",1517,8))

LISTEN    0    128                                                   :::42480                                                 :::*    users:(("rpc.mountd",3684,10))

[root@test1 yum.repos.d]#

六、nmcli

nmcli  [ OPTIONS ] OBJECT { COMMAND | help }

device - show and manage network interfaces

connection - start, stop, and manage network connections

如何修改IP地址等屬性:

#nmcli connection modify IFACE [+|-]setting.property value

setting.property:

ipv4.addresses

ipv4.gateway

ipv4.dns1

ipv4.method

manual

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


當前標題:Linux網(wǎng)絡管理工具-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://weahome.cn/article/ghcpg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部