目前分類:系統管理 (432)

瀏覽方式: 標題列表 簡短摘要

AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄

以下測試環境:
FreeBSD 12.1-RELEASE
apache24/httpd-2.4.41
awstats-7.7

更新ports
# portsnap fetch update

安裝 apache24
# cd /usr/ports/www/apache24/
# make install clean

接下來安裝 AWStats
# cd /usr/ports/www/awstats/
# make install clean

設定apache, 將以下註解拿掉
# cd /usr/local/etc/apache24/
# vi httpd.conf
LoadModule cgid_module libexec/apache24/mod_cgid.so

設定vhost , 如果這台是單一功能的機器也可以直接寫在 httpd.conf 內
# cd /usr/local/etc/apache24/Includes/
# vi awstats.conf
<VirtualHost *:80>
        ServerAdmin webadm@staff.pass.tw
        ServerName awstats.pass.tw
        ErrorLog /home/archive/logs/error_log-awstats.log
        CustomLog /home/archive/logs/access_log-awstats.log combined

        Alias /awstatsclasses "/usr/local/www/awstats/classes/"
        Alias /awstatscss "/usr/local/www/awstats/css/"
        Alias /awstatsicons "/usr/local/www/awstats/icon/"
        ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

        <Directory "/usr/local/www/awstats/">
                Options None
                AllowOverride None
                Require all granted
        </Directory>
        <Directory "/usr/local/www/awstats/cgi-bin/">
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
</VirtualHost>

重新啟動apache
# apachectl restart

編輯設定檔,簡單調整適合自己的設定
# cd /usr/local/www/awstats/cgi-bin/
# cp awstats.model.conf awstats.pass.tw.conf
# vi awstats.pass.tw.conf
LogFile="gzip -cd /home/workdir/access_log.pass.tw*.gz |"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="books.pass.tw"
DirData="/usr/local/www/awstats/data"

開始分析數據
# mkdir /usr/local/www/awstats/data
# /usr/local/www/awstats/cgi-bin/awstats.pl -config=pass.tw -update

打開瀏覽器,網址輸入
http://主機名稱或ip/awstats/awstats.pl?config=設定檔

http://awstats.pass.tw/awstats/awstats.pl?config=pass.tw

測試如果正常的話,將 /usr/local/www/awstats/cgi-bin/awstats.pl 寫入 crontab 每日固定時間執行即可

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

FreeBSD 安裝 AWStats

AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄

以下測試環境:
FreeBSD 12.1-RELEASE
apache24/httpd-2.4.41
awstats-7.7

更新ports
# portsnap fetch update

安裝 apache24
# cd /usr/ports/www/apache24/
# make install clean

接下來安裝 AWStats
# cd /usr/ports/www/awstats/
# make install clean

設定apache, 將以下註解拿掉
# cd /usr/local/etc/apache24/
# vi httpd.conf
LoadModule cgid_module libexec/apache24/mod_cgid.so

設定vhost , 如果這台是單一功能的機器也可以直接寫在 httpd.conf 內
# cd /usr/local/etc/apache24/Includes/
# vi awstats.conf
<VirtualHost *:80>
        ServerAdmin webadm@staff.pass.tw
        ServerName awstats.pass.tw
        ErrorLog /home/archive/logs/error_log-awstats.log
        CustomLog /home/archive/logs/access_log-awstats.log combined

        Alias /awstatsclasses "/usr/local/www/awstats/classes/"
        Alias /awstatscss "/usr/local/www/awstats/css/"
        Alias /awstatsicons "/usr/local/www/awstats/icon/"
        ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

        <Directory "/usr/local/www/awstats/">
                Options None
                AllowOverride None
                Require all granted
        </Directory>
        <Directory "/usr/local/www/awstats/cgi-bin/">
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
</VirtualHost>

重新啟動apache
# apachectl restart

編輯設定檔,簡單調整適合自己的設定
# cd /usr/local/www/awstats/cgi-bin/
# cp awstats.model.conf awstats.pass.tw.conf
# vi awstats.pass.tw.conf
LogFile="gzip -cd /home/workdir/access_log.pass.tw*.gz |"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="books.pass.tw"
DirData="/usr/local/www/awstats/data"

開始分析數據
# mkdir /usr/local/www/awstats/data
# /usr/local/www/awstats/cgi-bin/awstats.pl -config=pass.tw -update

打開瀏覽器,網址輸入
http://主機名稱或ip/awstats/awstats.pl?config=設定檔

http://awstats.pass.tw/awstats/awstats.pl?config=pass.tw

測試如果正常的話,將 /usr/local/www/awstats/cgi-bin/awstats.pl 寫入 crontab 每日固定時間執行即可

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

目前幾乎所有的瀏覽器都已支援壓縮功能
以下幾個網站可以方便檢測你的網站是否有開啟壓縮的功能
https://aruljohn.com/gziptest.php
https://www.whatsmyip.org/http-compression-test/
http://www.gidnetwork.com/tools/gzip-test.php

操作方式都一樣,只需輸入網址就可以方便知道結果


undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

情境
example.com/a/test.html -> a.example.com/test.html
example.com/b/test.html -> b.example.com/test.html

# vi /etc/varnish/default.vcl
 

vcl 4.0;

import directors;
import std;

[.... 中間略 ....]

sub vcl_recv {
    if (req.http.host ~ "example.com") {
        if (req.url ~ "^/a/") {
            set req.url = regsub(req.url, "^/a","");
            set req.http.host = "a.example.com";
            set req.backend_hint = a.backend();
        } else if (req.url ~ "^/b/") {
            set req.url = regsub(req.url, "^/b","");
            set req.http.host = "b.example.com";
            set req.backend_hint = b.backend();
        }
    }
}

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

我們可能會遇到系統硬體不夠力,想要換一台新的NAS
或是空間不族,想要更換大一點的硬碟空間

首先除了先要把裡面的資料備份出來外
如果原來的設定很單純的話,當然可以直接在新機器上面設定
但是如果裡面很多的服務和帳號的話,建議還是用系統提供的備份還原機制

控制台 -> 更新 & 還原 -> 系統設定備份

1. 備份設定
系統會將以下的設定及帳號密碼備份出來一個 .dss 的檔案

2. 還原設定
(1) 選擇要還原哪一個備份檔

(2) 選擇要還原的設定及是否要覆寫衝突
如果是全新的設定的話,當然是全選
但是如果只是單純因為前一刻手誤,不小心改壞設定或是誤刪帳號,就可以選擇各別的設定還原






PS. 還原設定的時候不會異動到網路設定,所以可以不用擔心新舊兩台機器會有IP 衝突的狀況
 

undefined

 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

測試Synology DS413 可以抓到單顆10TB硬碟
但是這個型號的NAS 每個 volume 的上限是 16TB
所以裝 10TB的硬碟很尷尬
做成 raid10 / raid5 / raid6 都會超過 16TB
只能做成兩個raid1 的 volume



官方資料
https://www.synology.com/zh-tw/knowledgebase/DSM/tutorial/Storage/Why_does_my_Synology_NAS_have_a_single_volume_size_limitation

因應現在硬碟空間愈做愈大,建議就買可以上到108TB 的機型

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

手頭上剛好有 Dell R310 和 4顆SEAGATE 10TB的硬碟
想要來試試可不可以用舊機器裝一台空間大一點的NAS

進到 Raid BIOS , 很順利的抓到10TB的硬碟
也可以成功建立 Raid 5 && Virtual Disk

但進到CentOS 8 的安裝介面的時候,看不到剛剛建立的 Virtual Disk

結論: 失敗,冏
undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

首先介紹 runuser 這個指令

# runuser --help

Usage:
 runuser [options] -u <user> [[--] <command>]
 runuser [options] [-] [<user> [<argument>...]]

Run <command> with the effective user ID and group ID of <user>.  If -u is
not given, fall back to su(1)-compatible semantics and execute standard shell.
The options -c, -f, -l, and -s are mutually exclusive with -u.

Options:
 -u, --user <user>               username
 -m, -p, --preserve-environment  do not reset environment variables
 -g, --group <group>             specify the primary group
 -G, --supp-group <group>        specify a supplemental group

 -, -l, --login                  make the shell a login shell
 -c, --command <command>         pass a single command to the shell with -c
 --session-command <command>     pass a single command to the shell with -c
                                   and do not create a new session
 -f, --fast                      pass -f to the shell (for csh or tcsh)
 -s, --shell <shell>             run <shell> if /etc/shells allows it
 -P, --pty                       create a new pseudo-terminal

 -h, --help                      display this help
 -V, --version                   display version


For more details see runuser(1).

範例:
runuser -l mongod -c '/usr/bin/mongod -f /home/example/mongod-27020.conf'

runuser -l mongod -c '/usr/bin/mongod -f /home/example/mongod-27020.conf --shutdown'

透過這個做法,我們可以將開機後要執行的服務寫在同一支 script 中,方便重開機後自動執行,很方便喔

另外還有幾種作法,也是可以在root 的權限下,使用特定的使用者權限來執行程式,提供作參考
1. su - username
2. suid (set uid)

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

https://www.apple.com/tw/macos/catalina/

macOS Catalina是蘋果公司用於麥金塔電腦的桌面作業系統 macOS 的第16個主要版本。它是 macOS Mojave 的繼任者,於2019年6月3日在蘋果全球開發者大會發布,並於2019年10月8日正式推出。Catalina 是第一個只支援64位元應用程式的 macOS 版本。
節錄自維基百科
https://zh.wikipedia.org/zh-tw/MacOS_Catalina

升級了這次的macOS 最主要的災情應該就是不能在執行原本已經安裝的32bit 軟體
如果是安裝舊版的microsoft office , 則會讓你安裝 office 365
之前跟微軟買斷的office 也只能跟這台電腦說881 

如果原來已經安裝了32bit的軟體也有可能因為升級,而無法 uninstall 
讓你看的到用不到,也丟不掉... orz

總之,這次升級前就好好三思一下

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

1. 如果還沒安裝 portupgrade 套件,請先安裝該套件

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

2. 列出 portsclean 功能

#  portsclean -h
portsclean 2.4.15 (2019/10/04)

usage: portsclean [-hCDDiLnPPQQq]

    -h, --help         Show this message
    -C, --workclean    Clean up working directories
    -D, --distclean    Clean up distfiles which are not referenced from any
                       port in the ports tree;
                       Specified twice, clean up distfiles which are not
                       referenced from any port that is currently installed
    -i, --interactive  Turn on interactive mode
    -L, --libclean     Clean up old shared libraries
    -n, --noexecute    Do not actually delete files
    -P, --pkgclean     Clean up outdated package tarballs;
                       Specified twice, delete all the package tarballs
    -Q, --quiet        Do not write anything to stdout;
                       Specified twice, stderr neither
    -q, --noconfig     Do not read pkgtools.conf

Environment Variables [default]:
    PACKAGES         packages directory [$PORTSDIR/packages]
    PKGTOOLS_CONF    configuration file [$PREFIX/etc/pkgtools.conf]
    PKG_DBDIR        packages DB directory [/var/db/pkg]
    PORTSDIR         ports directory [/usr/ports]
    PORTS_DBDIR      ports db directory [$PORTSDIR]
    PORTS_INDEX      ports index file [$PORTSDIR/INDEX]


3. 刪除 work 資料匣

# portsclean -C
Cleaning out /usr/ports/*/*/work...
Delete /usr/ports/databases/pecl-mongodb/work
Delete /usr/ports/shells/bash/work
Delete /usr/ports/textproc/xmlto/work
Delete /usr/ports/textproc/asciidoc/work
Delete /usr/ports/devel/libatomic_ops/work
Delete /usr/ports/devel/boehm-gc/work
Delete /usr/ports/devel/git/work
Delete /usr/ports/devel/cvsps/work
Delete /usr/ports/www/w3m/work
Delete /usr/ports/security/p5-Authen-SASL/work
Delete /usr/ports/security/p5-Digest-HMAC/work
Delete /usr/ports/misc/getopt/work
Delete /usr/ports/lang/p5-Error/work
done.

undefined
精通 Shell 程式設計(第四版)
Shell Programming in Unix, Linux and OS X, 4th Edition

作者: Stephen G. Kochan, Patrick Wood  
譯者: 蔡明志
出版社:碁峰

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

安裝好 wordpress 5 ,修改永久連結(Permalinks) 後新增文章
如果出現 Publishing failed 或是 發佈時發生錯誤 等錯誤訊息

請確認 apache 的 rewrite module 是否有安裝並啟用
<Directory "/home/www/wp">
    ....
    AllowOverride All
    ....
</Directory>

並且在 wordpress 的目錄下面新增一個 .htaccess 檔案
內容如下

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp5/index.php [L]
</IfModule>



undefined
WordPress架站的12堂課增訂版:網域申請x架設x佈景主題x廣告申請

作者: 張正麒, 何敏煌  
出版社:碁峰 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在 vmware esxi 安裝 windows 10 如果出現 efi vmware virtual sata cdrom Drive (0.0) ... unsuccessful 錯誤訊息
解決 vmware esxi 安裝 windows 10 出

可以檢查一下 VM Options 的設定
如果預設是選擇 EFI 的話,把他改成 BIOS 再重開機
解決 vmware esxi 安裝 windows 10 出

 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在瀏覽器輸入 synology nas 的主機名稱或是ip 的話
預設會自動轉址到 5000 port
如果想要轉址到其他應用服務去的話

可以修改以下檔案
# vi /usr/syno/share/nginx/WWWService.mustache


server {
    listen 80 default_server{{#reuseport}} reuseport{{/reuseport}};
    listen [::]:80 default_server{{#reuseport}} reuseport{{/reuseport}};

    gzip on;

    {{> /usr/syno/share/nginx/WWW_Main}}

    location ~ ^/$ {
        //rewrite / http://$host:{{DSM.port}}/ redirect;
        //取代成想要轉址的port

        rewrite / http://$host:8080/ redirect;
    }
}

最後重啟服務
# synoservicecfg --restart nginx

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

家裡有台 Sony Bravia 42" 電視
因為有時候會自動重開機,所以想更新一下軟體
也想順便測試一下直接用電視看Youtube

由於這台TV沒有內建無線網卡,瞄一下背後,有usb port 和 RJ-45
但家裡只有手機熱點可以分享網路給其他設備
所以就先拿了一張usb無線網卡插上去
結果不支援,爬文之後才發現他只支援 Bravia 電視專用的無線網卡
如: UWA-BR100

但是這張卡單價不便宜,台灣也沒什麼通路在賣
所以只能接有線了

測試環境
手機熱點 <- wifi -> BR-6428nS <- Lan -> Sony Bravia TV

以下是用【EDIMAX 訊舟】BR-6428nS V4 N300多模式無線網路分享器 實測畫面

undefined

EDIMAX 訊舟 BR-6428nS V4 N300多模式無線網路分享器
 
--高增益天線+特調無線參數,效能超越同級產品20%--
 
延續前一代BR-6428nS V3 優異的無線傳輸技術,搭配高增益天線,不僅讓您可於大空間的無線網路環境下輕鬆使用。針對現代住宅多隔間與多樓層,訊號死角多的問題,BR-6428nS V4 的無線訊號延伸器模式(Extender Mode)也提供了專為延伸跨樓層、多房間的無線網路環境設計的無線訊號延伸功能,它能延伸家中現有的無線網路、有效減少訊號死角,大幅提昇上網品質。
 
在設定安裝方面,BR-6428nS V4 採用新一代iQ Setup快速設定功能,讓您使用手機即可無障礙安裝,連線上網更快更方便。同時,BR-6428nS V4 智慧五合一多模式設計,大幅簡化繁複設定,讓一台無線分享器可輕易變身為「無線訊號延伸器(Range Extender Mode)」、「無線基地台(Access Point Mode)」、「無線橋接器(AP Client)」及「無線公共熱點(WISP)」,使您的網路環境應用更添彈性,而這樣的功能切換,只要透過手機或平板執行iQSetup,您不必是行家也可輕鬆操作。
 
此外,BR-6428nS V4 同樣採用最新Green WLAN技術,內建新一代低溫無線晶片,可以主動調整資料傳輸所需電量,省電效果高達66%,重點是節能省電之外,絕對不省效能,讓您在馳騁無線網上的同時,也能為綠色環保盡一分心力。

1. 找一台電腦網卡設成dhcp自動抓取, 並接上 BR-6428nS 的Lan port
網址輸入 http://edimax.setup/
如果需要帳號密碼,出廠的預設值是 admin / 1234
選擇 WISP 模式


2. 選擇手動設定


3. 選擇一個基地台,也就是你手機的熱點


4. 輸入密碼


5. 下一步


6. 下一步


7. 設定你這台分享器的ssid 和密碼


8. 設定完成


9. 等待設備同步完設定


10. 恭喜,設定完成

接下來就是把電視和分享器用網路線接起來就可以了
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在esxi 6.x 的web 管理介面新增一個使用者第一個步驟
Host -> Manage -> Security & Users -> User -> Add User

新增完之後的使用者還沒有任何的權限
就跟MS SQL 或是 Sybase 之類的資料庫一樣
還需要指派角色後才能真正使用

指派角色的步驟如下
1. Host -> Actions -> Permissions


2. Add user



3. 輸入剛剛新增的user 並指派角色



4. Add user



最後開啟無痕瀏覽或是登出再用新帳號登入測試

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

如果是把usb 隨身碟格式化成預設的 FAT32
無法寫入單一檔案超過4GB 資料

解決方式:
將usb 格式化成 exFAT



undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

安裝完 CentOS 7 最小安裝後
會發現以前習慣的工具預設都不會安裝了,取而代之的是新的指令
如果還是習慣以前的工具的話可以另外再透過yum 安裝
例如

nslookup
dig
host
# yum -y install bind-utils

ifconfig
netstat
# yum -y install net-tools

iostat
# yum -y install sysstat

另外如果還想再安裝其他工具,但不知道要安裝哪個套件的話
可以執行以下指令,來找到應該要安裝哪一個套件

# yum provides */iostat
or
# yum provides iostat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
pcp-4.1.0-4.el7.x86_64 : System-level performance monitoring and performance management
Repo        : base
Matched from:
Filename    : /var/lib/pcp/config/pmlogconf/tools/iostat

pcp-4.1.0-5.el7_6.x86_64 : System-level performance monitoring and performance management
Repo        : updates
Matched from:
Filename    : /var/lib/pcp/config/pmlogconf/tools/iostat

pcp-testsuite-4.1.0-4.el7.x86_64 : Performance Co-Pilot (PCP) test suite
Repo        : base
Matched from:
Filename    : /var/lib/pcp/testsuite/sadist/iostat

pcp-testsuite-4.1.0-5.el7_6.x86_64 : Performance Co-Pilot (PCP) test suite
Repo        : updates
Matched from:
Filename    : /var/lib/pcp/testsuite/sadist/iostat

sysstat-10.1.5-17.el7.x86_64 : Collection of performance monitoring tools for Linux
Repo        : base
Matched from:
Filename    : /usr/bin/iostat

undefined
鳥哥的Linux私房菜:基礎學習篇(附DVD一片)(第四版)

作者: 鳥哥  
出版社:碁峰

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

[root@example-08 log]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.7.26-29-57-log

Copyright (c) 2009-2019 Percona LLC and/or its affiliates
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 如果是想直接 update mysql.user 的 table 的話,會出現以下錯誤
mysql> UPDATE mysql.user SET password=PASSWORD("passw0rd") where user='root';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

# 請使用 alter user 指令來變更密碼
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'passw0rd';
Query OK, 0 rows affected (0.01 sec)

# 如果有修改 mysql 使用者相關權限都建議再執行以下指令
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

undefined
Python大數據特訓班:資料自動化收集、整理、分析、儲存與應用實戰(附近300分鐘影音教學/範例程式)

作者: 文淵閣工作室  
出版社:碁峰  
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在 CentOS 安裝好 Percona XtraDB Cluster 5.7
也正常啟用 mysql server 了
systemctl start mysql
但是無法用空密碼登入了
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

如何找到系統初始密碼?
找到 /var/log/mysqld.log
其中一行
2019-06-28T05:18:57.787444Z 1 [Note] A temporary password is generated for root@localhost: G3hshe5csL/q

沒錯,最後一個字串就是你root 密碼了

undefined
大數據分析之資料庫理論與實務(SQL Server 2017版)

作者: 曾守正, 周韻寰  
出版社:華泰文化  
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在linux / unix 中
很習慣用 ifconfig -a 指令來檢查網路的狀態

但是在 CentOS 7 最小安裝完後
想要下這個指令
卻發現找不到了

原來是用 ip addr 這個指令來取代了
[root@example-08 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:xx:xx:xx:83 brd ff:ff:ff:ff:ff:ff
    inet 192.168.80.8/24 brd 192.168.200.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:fe30:2e83/64 scope link
       valid_lft forever preferred_lft forever

如果還是跟我一樣習慣舊指令的話
可以安裝 net-tools 套件
[root@example-08 ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * updates: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.24.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch         Version                          Repository  Size
================================================================================
Installing:
 net-tools       x86_64       2.0-0.24.20131004git.el7         base       306 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 306 k
Installed size: 918 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm              | 306 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.24.20131004git.el7.x86_64                    1/1
  Verifying  : net-tools-2.0-0.24.20131004git.el7.x86_64                    1/1

Installed:
  net-tools.x86_64 0:2.0-0.24.20131004git.el7

Complete!

ip 指令的其他用法
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
                   netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |
                   vrf }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec |
                    -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |
                    -4 | -6 | -I | -D | -B | -0 |
                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |
                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
                    -rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}

undefined
CentOS 7.3建置、管理與伺服器架設實戰

作者: 湯秉翰  
出版社:博碩  
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

Close

您尚未登入,將以訪客身份留言。亦可以上方服務帳號登入留言

請輸入暱稱 ( 最多顯示 6 個中文字元 )

請輸入標題 ( 最多顯示 9 個中文字元 )

請輸入內容 ( 最多 140 個中文字元 )

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼