成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

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

一、ifconfig命令

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

ifconfig是linux中用于顯示或配置網(wǎng)絡(luò)設(shè)備(網(wǎng)絡(luò)接口卡)的命令,英文全稱是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]#

通過這個(gè)命令可以看到網(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)計(jì)

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

2、ifconfig interface [up|down]  //啟動(dòng)接口或禁用接口

3、ifconfig interface IP/mask  //為接口設(shè)置ip地址

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

二、route

查看:route -n

添加:route add

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

目標(biāo):192.168.1.3  網(wǎng)關(guān):172.16.0.1

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

目標(biāo):192.168.0.0 網(wǎng)關(guān):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

默認(rèn)路由,網(wǎng)關(guān):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]

目標(biāo):192.168.1.3  網(wǎng)關(guān):172.16.0.1

~]# route del -host 192.168.1.3

目標(biāo):192.168.0.0 網(wǎng)關(guān):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)絡(luò)連接:

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

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

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

-w: raw socket相關(guān)

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

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

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

-e:擴(kuò)展格式

-p: 顯示相關(guān)進(jìn)程及PID

常用組合:

-tan, -uan, -tnl, -unl

顯示路由表:

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

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

-n: 數(shù)字格式

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

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

# netstat -i

# netstat -I IFACE

四、ip

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

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

可設(shè)置屬性:

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

show

[dev IFACE]:指定接口

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

ip address - protocol address management

ip addr { add | del } IFADDR dev STRING

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

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

global: 全局可用;

link: 僅鏈接可用;

host: 本機(jī)可用;

[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:

主機(jī)路由: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]

五、ss

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

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

選項(xiàng):

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

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

-w: 裸套接字相關(guān)

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

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

-a: 所有

-n: 數(shù)字格式

-p: 相關(guān)的程序及PID

-e: 擴(kuò)展的信息

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

-o:計(jì)時(shí)器信息

運(yùn)行結(jié)果一目了然,而且速度很快

[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

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

網(wǎng)站標(biāo)題:Linux網(wǎng)絡(luò)管理工具-創(chuàng)新互聯(lián)
分享鏈接:http://jinyejixie.com/article36/ghcpg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站改版、手機(jī)網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計(jì)Google網(wǎng)站營(yíng)銷

廣告

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

外貿(mào)網(wǎng)站制作
长海县| 内丘县| 临邑县| 无极县| 湄潭县| 东方市| 长丰县| 五寨县| 合作市| 湛江市| 肥城市| 甘洛县| 高碑店市| 酉阳| 靖江市| 拉孜县| 长顺县| 南涧| 长白| 东海县| 瑞丽市| 三亚市| 都匀市| 斗六市| 武威市| 嘉义市| 石首市| 体育| 彝良县| 昭平县| 孝昌县| 秭归县| 东乌| 鱼台县| 辽宁省| 江油市| 合肥市| 会宁县| 高淳县| 横山县| 七台河市|