Firefox 3 是我最常用的瀏覽器之一。他有許多的強大外掛和高自訂性的介面,方便我每天的例行性工作。官方今天推出了最新版本 4 RC,利用這個機會紀錄一下目前所用的外掛。另外也順便推薦給大家!
Extensions:
User Scripts:
User Styles:
Fonts:
2011年3月10日
2010年10月14日
Ubuntu 網頁分享
一些不錯的 Ubuntu 網頁分享給大家:
- Ubuntu 一日遊專區 -鉅細靡遺的 Ubuntu 百科
- Ubuntu 常用技巧 - 整理出常用的許多功能
- Ubuntu 使用手冊 - 官方 man page
- Ubuntu 部屬雲端 - 實作教學十分清楚用心
- Ubuntu 增加靜態路由 - 常常有 Ubuntu 完整測試與教學
2010年2月11日
Google Buzz 正式推出!
今天馬上就給他用了一下,真是好物阿。
Google 每次的新玩意總是設計貼心、又很人性化
讓人愛到心坎裡!
全球用戶將會陸陸續續啟用 Google Buzz 功能
建議可以先登出所有 Gmail 信箱再重新登入
沒意外的話就會看見歡迎訊息囉~
介紹文就先跳過吧:幾位大大都已經率先發表囉!
Google 每次的新玩意總是設計貼心、又很人性化
讓人愛到心坎裡!
全球用戶將會陸陸續續啟用 Google Buzz 功能
建議可以先登出所有 Gmail 信箱再重新登入
沒意外的話就會看見歡迎訊息囉~
介紹文就先跳過吧:幾位大大都已經率先發表囉!
2010年2月5日
Spiceworks 網管軟體設定筆記
Spiceworks 是一套完整的 IT Management Software。可以讓網管或系統人員透過網頁平台管理全公司的軟硬體資產。目前主要功能如下:
Spiceworks 電腦端設定
請將 C:\Program Files\Spiceworks 目錄與所有子目錄加入防毒軟體的例外清單中
並將下列執行檔加入防火牆的例外,允許 Spiceworks 執行與分析
直接關閉 Windows 防火牆亦可,但較不安全。建議的做法是只開啟上表所列之通訊 PORT。若還是無法順利連線時,則再下 netsh firewall set service remoteadmin enable 強制開啟遠端管理服務。
安裝完畢後請於 Spiceworks 安裝的電腦上,執行下面指令來確認連線是否正常。
開始 → 執行 → cmd.exe
wmic /user:USER_NAME /password:USER_PASSWORD /node:IPADDRESS systemenclosure get serialnumber
USER_NAME = 網域帳號、本機帳號、SSH 帳號或 SNMP 名稱
USER_PASSWORD = 密碼
IPADDRESS = 未知裝置的 IP 位置
如果能正常看見序號回應如下,則表示連線暢通
Serial Number
2iduekfj45ufh
如果出現如下畫面,可能是 Local WMI 權限或 DCOM 組態設定錯誤。
請參考官網解決方式:Troubleshooting WMI
ERROR:
Code = 0x80070005
Description: Access is denied
Facility = Win32
如果不能正常回應,有以下可能:
- 軟硬體資產管理
- 系統、網路監控
- Network Map 繪製
- Help Desk 系統
- IT Service 管理
- 報告分析、管理
- User Portal
- 圖形化整合介面...
Spiceworks 電腦端設定
請將 C:\Program Files\Spiceworks 目錄與所有子目錄加入防毒軟體的例外清單中
並將下列執行檔加入防火牆的例外,允許 Spiceworks 執行與分析
- C:\Program Files\Spiceworks\httpd\bin\spiceworks-httpd.exe
- C:\Program Files\Spiceworks\bin\spiceworks.exe
- C:\Program Files\Spiceworks\bin\spicetray.exe
- C:\Program Files\Spiceworks\bin\spiceworks-finder.exe
- C:\Program Files\Spiceworks\pkg\gems\spiceworks_common-x.x.xxxxx\nbtscan\nbtscan.exe
- ICMPv4 Inbound and Outbound - This is needed so that Spiceworks can discover the devices on your network; it is more commonly known as the PING command. There are a number of types of ping commands that can be permitted or blocked by various firewalls. Generally, you will want to permit (commands 0, 3 8 and 11). Some firewalls don't distinguish between these, so you will need to check the settings on your specific firewall. Many firewalls will already be configured for (0,3,8), so you will need to make sure the (command 11 (echo)) is allowed through the firewall.
- TCP Ports 135 and 445 Inbound - This is needed for Windows Management Instrumentation (WMI) which Spiceworks uses to get detailed information about Windows computers.
- UDP Port 137 Inbound - This is needed so that Spiceworks can gather information in the Windows Registry.
- TCP 1024 - 2000 Inbound - Dynamic Ports for Windows Management Instrumentation (WMI).
直接關閉 Windows 防火牆亦可,但較不安全。建議的做法是只開啟上表所列之通訊 PORT。若還是無法順利連線時,則再下 netsh firewall set service remoteadmin enable 強制開啟遠端管理服務。
安裝完畢後請於 Spiceworks 安裝的電腦上,執行下面指令來確認連線是否正常。
開始 → 執行 → cmd.exe
wmic /user:USER_NAME /password:USER_PASSWORD /node:IPADDRESS systemenclosure get serialnumber
USER_NAME = 網域帳號、本機帳號、SSH 帳號或 SNMP 名稱
USER_PASSWORD = 密碼
IPADDRESS = 未知裝置的 IP 位置
如果能正常看見序號回應如下,則表示連線暢通
Serial Number
2iduekfj45ufh
如果出現如下畫面,可能是 Local WMI 權限或 DCOM 組態設定錯誤。
請參考官網解決方式:Troubleshooting WMI
ERROR:
Code = 0x80070005
Description: Access is denied
Facility = Win32
如果不能正常回應,有以下可能:
- 帳號密碼不正確、或權限不足
- 遠端裝置的防火牆阻擋了 WMI 連線
- 遠端裝置的 WMI 連線設定錯誤
圖解教學:
- Default DCOM Properties And Security 設定 DCOM 組態與安全性
- Default WMI Namespace Security 設定 WMI 安全性
參考資料:
2010年1月28日
Ubuntu 超好用軟體補完
sudo apt-get install gimp
# 媲美 PhotoShop 的影像處理軟體
sudo apt-get install gqview
# 輕巧快速的圖片瀏覽程式
suod apt-get install gthumb
# 好用的圖片管理程式
sudo apt-get install stardict
# 星際譯王 - 翻譯軟體
# 可到官網下載字典與真人發音 http://stardict.sourceforge.net
sudo apt-get install k3b
# KDE 底下強大的燒錄軟體
sudo apt-get install gnomebaker
# Gnome 底下新的燒錄軟體
sudo apt-get install brasero
# Ubuntu 內建燒錄軟體 ( 9.04 之後版本 )
sudo apt-get install openoffice
# Linxu 底下強大的文書處理軟體 ( 媲美 Microsoft Office )
sudo apt-get install evince
# Ubuntu 內建 PDF 瀏覽程式
sudo apt-get install kpdf
# KDE 底下 PDF 瀏覽程式
sudo apt-get install xpdf xpdf-chinese-traditional
# PDF 瀏覽程式
sudo apt-get install nvu-dev
# 網頁製作軟體
sudo apt-get install pcmanfm
# PCMan 開發的輕量化檔案瀏覽器
# 媲美 PhotoShop 的影像處理軟體
sudo apt-get install gqview
# 輕巧快速的圖片瀏覽程式
suod apt-get install gthumb
# 好用的圖片管理程式
sudo apt-get install stardict
# 星際譯王 - 翻譯軟體
# 可到官網下載字典與真人發音 http://stardict.sourceforge.net
sudo apt-get install k3b
# KDE 底下強大的燒錄軟體
sudo apt-get install gnomebaker
# Gnome 底下新的燒錄軟體
sudo apt-get install brasero
# Ubuntu 內建燒錄軟體 ( 9.04 之後版本 )
sudo apt-get install openoffice
# Linxu 底下強大的文書處理軟體 ( 媲美 Microsoft Office )
sudo apt-get install evince
# Ubuntu 內建 PDF 瀏覽程式
sudo apt-get install kpdf
# KDE 底下 PDF 瀏覽程式
sudo apt-get install xpdf xpdf-chinese-traditional
# PDF 瀏覽程式
sudo apt-get install nvu-dev
# 網頁製作軟體
sudo apt-get install pcmanfm
# PCMan 開發的輕量化檔案瀏覽器
Ubuntu 多媒體影音支援筆記
sudo apt-get install libdvdcss2
# 安裝 DVD CSS 支援
sudo apt-get install w32codecs
# 安裝 win32 codec 支援
sudo apt-cache search mplayer
# 搜尋可供安裝的 MPlayer 版本
sudo apt-get install mplayer
# 安裝 MPlayer 多媒體播放程式 ( 可撥放 AVI、DVD、VCD 等格式 )
sudo apt-get install mplayer-fonts
sudo apt-get install mozilla-mplayer
# 安裝 MPlayer 字型與 Mozilla 外掛
sudo apt-get install xine-ui
# 安裝 xine 多媒體播放程式 ( 可撥放 AVI、DVD、VCD、XVID 等格式 )
sudo apt-get install libxine-extracodecs
# 安裝 xine 影音格式支援
sudo apt-get install vlc
# 安裝 VLC 跨平台多媒體串流播放程式
sudo apt-get install totem
# 安裝 Totem Ubuntu 內建多媒體播放程式
sudo apt-get install totem-gstreamer
# 將 Totem 播放引擎改為 Gstreamer
sudo apt-cache search gstreamer
# 查詢可供安裝的 Gstreamer 模組
sudo apt-get install totem-xine
# 將 Totem 播放引擎改為 xine
sudo apt-get install rhythmbox
# 支援 iPod 的音樂播放程式 ( 播放 CD、MP3 等格式 )
sudo apt-get install amarok
# 支援 iPod 的音樂播放程式 ( 播放 CD、MP3 等格式 )
sudo apt-get install streamtuner
# 用 Ubuntu 聽廣播 ( 大部分為國外電台 )
sudo apt-get install hinedo
# 用 Ubuntu 聽廣播 ( 幾乎都是台灣電台 )
# 安裝 DVD CSS 支援
sudo apt-get install w32codecs
# 安裝 win32 codec 支援
sudo apt-cache search mplayer
# 搜尋可供安裝的 MPlayer 版本
sudo apt-get install mplayer
# 安裝 MPlayer 多媒體播放程式 ( 可撥放 AVI、DVD、VCD 等格式 )
sudo apt-get install mplayer-fonts
sudo apt-get install mozilla-mplayer
# 安裝 MPlayer 字型與 Mozilla 外掛
sudo apt-get install xine-ui
# 安裝 xine 多媒體播放程式 ( 可撥放 AVI、DVD、VCD、XVID 等格式 )
sudo apt-get install libxine-extracodecs
# 安裝 xine 影音格式支援
sudo apt-get install vlc
# 安裝 VLC 跨平台多媒體串流播放程式
sudo apt-get install totem
# 安裝 Totem Ubuntu 內建多媒體播放程式
sudo apt-get install totem-gstreamer
# 將 Totem 播放引擎改為 Gstreamer
sudo apt-cache search gstreamer
# 查詢可供安裝的 Gstreamer 模組
sudo apt-get install totem-xine
# 將 Totem 播放引擎改為 xine
sudo apt-get install rhythmbox
# 支援 iPod 的音樂播放程式 ( 播放 CD、MP3 等格式 )
sudo apt-get install amarok
# 支援 iPod 的音樂播放程式 ( 播放 CD、MP3 等格式 )
sudo apt-get install streamtuner
# 用 Ubuntu 聽廣播 ( 大部分為國外電台 )
sudo apt-get install hinedo
# 用 Ubuntu 聽廣播 ( 幾乎都是台灣電台 )
2010年1月15日
Port Mirroring 筆記
公司想要偵測內網中每個使用者的網路行為,試過許多方式後,最後決定用 Port Mirror 技術搭配 nTop 封包分析套件,統計所有資訊,本篇為 Port Mirror 筆記,如有錯誤,還請指教!
首先我用一台 Pentium II - 400Mhz 主機安裝 Ubuntu Server 9.10
本機須裝設兩張網卡,一張用來讓管理者連線用,一張擷取 Port Mirror 的所有網路封包
裝完後再安裝 nTop 套件 ( nTop 的安裝設定方式另篇詳述 )
最後連去 L3 Switch 設定 Port Mirror 方法如下:
show monitor session 2
# 顯示 session 2 狀態
enable
configure terminal
no monitor session 2
# 啟用管理原模式
# 進入變更設定模式
# 停用 session 2 監控
monitor session 2 source interface fastEthernet 0/3
# 監控的第一個來源 PORT
monitor session 2 source interface fastEthernet 0/4
# 監控的第二個來源 PORT
monitor session 2 destination interface fastEthernet 0/45
# 目的地 PORT
show monitor session 2
# 顯示 session 2 監控狀態
Session 2 ---------
Type : Local Session
Source Ports : Both : Fa0/3-4
Destination Ports : Fa0/45
Encapsulation : Native
Ingress : Disabled
# 設定無誤的話將會看到如上面畫面
Monitor session 1 source interface fastethernet 0/1 , 0/2 , 0/3
# Cisco 2950 多個來源可以直接設定
Monitor session 1 destination interface fastethernet 0/4 encap ingress vlan 1
# Cisco 2950 目的地 PORT 範例
完成後就可以透過 nTop 管理介面登入查看內網的流量囉!可惜 Pentium II 的電腦真的是慢了點,不然這台超強流量分析機就完美了XD"
首先我用一台 Pentium II - 400Mhz 主機安裝 Ubuntu Server 9.10
本機須裝設兩張網卡,一張用來讓管理者連線用,一張擷取 Port Mirror 的所有網路封包
裝完後再安裝 nTop 套件 ( nTop 的安裝設定方式另篇詳述 )
最後連去 L3 Switch 設定 Port Mirror 方法如下:
show monitor session 2
# 顯示 session 2 狀態
enable
configure terminal
no monitor session 2
# 啟用管理原模式
# 進入變更設定模式
# 停用 session 2 監控
monitor session 2 source interface fastEthernet 0/3
# 監控的第一個來源 PORT
monitor session 2 source interface fastEthernet 0/4
# 監控的第二個來源 PORT
monitor session 2 destination interface fastEthernet 0/45
# 目的地 PORT
show monitor session 2
# 顯示 session 2 監控狀態
Session 2 ---------
Type : Local Session
Source Ports : Both : Fa0/3-4
Destination Ports : Fa0/45
Encapsulation : Native
Ingress : Disabled
# 設定無誤的話將會看到如上面畫面
Monitor session 1 source interface fastethernet 0/1 , 0/2 , 0/3
# Cisco 2950 多個來源可以直接設定
Monitor session 1 destination interface fastethernet 0/4 encap ingress vlan 1
# Cisco 2950 目的地 PORT 範例
完成後就可以透過 nTop 管理介面登入查看內網的流量囉!可惜 Pentium II 的電腦真的是慢了點,不然這台超強流量分析機就完美了XD"
Ubuntu 中文輸入法安裝與設定
sudo apt-get install gdesklets
# Gnome 桌面小工具
im-switch 是官方提供的輸入法引擎選擇系統,可以快速變更或設定輸入法。本指令不需要 superuser 即可執行;如果使用 superuser 執行,則會改變全系統的設定值。
sudo apt-get install im-switch
# 安裝 im-switch
im-switch -l
# 列出安裝的輸入法
im-switch -s
# 選擇已安裝的輸入法 ( Example: im-switch -s gcin )
sudo im-switch -z zh_TW -s scim
sudo im-switch -z zh_HK -s scim
sudo im-switch -z zh_CN -s scim
sudo im-switch -z ja_JP -s scim
# 也可以加上 -z 變更語系
sudo apt-get install scim
# SCIM 萬國語言輸入法 ( Ubuntu 9.04 以前內建輸入法 )
sudo apt-get install gcin
# GCIN 中文輸入法 ( 滿多人使用的,超穩 )
sudo apt-get install ibus
# IBUS 多國語言輸入法平台 ( Ubuntu 9.10 首度採用,個人覺得還不是很穩定 )
# Gnome 桌面小工具
im-switch 是官方提供的輸入法引擎選擇系統,可以快速變更或設定輸入法。本指令不需要 superuser 即可執行;如果使用 superuser 執行,則會改變全系統的設定值。
sudo apt-get install im-switch
# 安裝 im-switch
im-switch -l
# 列出安裝的輸入法
im-switch -s
# 選擇已安裝的輸入法 ( Example: im-switch -s gcin )
sudo im-switch -z zh_TW -s scim
sudo im-switch -z zh_HK -s scim
sudo im-switch -z zh_CN -s scim
sudo im-switch -z ja_JP -s scim
# 也可以加上 -z 變更語系
sudo apt-get install scim
# SCIM 萬國語言輸入法 ( Ubuntu 9.04 以前內建輸入法 )
sudo apt-get install gcin
# GCIN 中文輸入法 ( 滿多人使用的,超穩 )
sudo apt-get install ibus
# IBUS 多國語言輸入法平台 ( Ubuntu 9.10 首度採用,個人覺得還不是很穩定 )
2010年1月14日
Ubuntu 網路應用程式懶人包
sudo apt-get install firefox
# 安裝 Firefox 網頁瀏覽器
sudo apt-get install flashplugin-nonfree
# 安裝 Flash 外掛 ( sudo update-flashplugin 安裝到 Firefox 中 )
sudo apt-get install sun-java6-jre sun-java6-plugin
# 安裝 Java 支援與外掛
sudo apt-get install mozilla-plugin-pcmanx
# 安裝 BBS 外掛支援
sudo apt-get install mozilla-mplayer
# 安裝 MPlayer 外掛,可讓 Firefox 支援撥放影片
sudo apt-get install mozilla-acroread cmap-adobe-cns1
# 安裝 Adobe Reader 外掛
sudo apt-get install xpdf xpdf-chinese-traditional
# 安裝 xPDF 文件閱讀器與正體中文字型支援
sudo apt-get remove mozilla-mplayer
sudo apt-get install totem-gstreamer totem-gstreamer-firefox-plugin
# 移除 MPlayer 外掛,安裝 GStreamer 多媒體播放引擎
sudo apt-get install thunderbird-locale-zh-tw
# 安裝 Thunderbird 電子郵件客戶端 ( 中文版 )
sudo apt-get install gaim
# 安裝 GAIM 即時通訊軟體
sudo apt-get install pidgin
# 安裝 Pidgin 即時通訊軟體 ( Ubuntu 9.04 以前內建 )
sudo apt-get install empathy
# 安裝 Empathy 即時通訊軟體 ( Ubuntu 9.10 以後採用 )
sudo deb http://download.skype.com/linux/repos/debian/ stable non-free
# 加入 Skype 來源套件庫
sudo apt-get update && sudo apt-get install skype
# 同步套件庫清單並安裝 Skype
sudo apt-cache search qt-immodule
# 搜尋對應的 Qt 模組,Skype 輸入中文必裝
sudo apt-get install
# 安裝輸入法 Qt 支援 ( ibus-qt4 or scim-qtimm or gcin-qt4-immodule )
sudo apt-get install ekiga
# SIP 網路語音視訊電話
sudo apt-get install pcmanx-gtk2
# 安裝經典 BBS 連線軟體 ( PCMan )
sudo apt-get install xchat
sudo apt-get install seamonkey-chatzilla
# 安裝 IRC 聊天軟體
sudo apt-get install gftp
# 老牌 FTP 傳輸軟體
sudo apt-get install filezilla
# 新一代 FTP 續傳軟體
sudo apt-get install d4x
# Linux 上的 FlashGet 下載工具
sudo apt-get install azureus
# P2P 下載工具 ( BitTorrent client )
sudo apt-get install transmission
# P2P 下載工具 ( lightweight BitTorrent client )
sudo apt-get install qbittorrent
# P2P 下載工具 ( bittorrent client using libtorrent-rasterbar with a nice Qt4 GUI )
sudo apt-get install amule
# 電驢下載工具
sudo apt-get install mldonkey-server
# 電驢伺服器
# 安裝 Firefox 網頁瀏覽器
sudo apt-get install flashplugin-nonfree
# 安裝 Flash 外掛 ( sudo update-flashplugin 安裝到 Firefox 中 )
sudo apt-get install sun-java6-jre sun-java6-plugin
# 安裝 Java 支援與外掛
sudo apt-get install mozilla-plugin-pcmanx
# 安裝 BBS 外掛支援
sudo apt-get install mozilla-mplayer
# 安裝 MPlayer 外掛,可讓 Firefox 支援撥放影片
sudo apt-get install mozilla-acroread cmap-adobe-cns1
# 安裝 Adobe Reader 外掛
sudo apt-get install xpdf xpdf-chinese-traditional
# 安裝 xPDF 文件閱讀器與正體中文字型支援
sudo apt-get remove mozilla-mplayer
sudo apt-get install totem-gstreamer totem-gstreamer-firefox-plugin
# 移除 MPlayer 外掛,安裝 GStreamer 多媒體播放引擎
sudo apt-get install thunderbird-locale-zh-tw
# 安裝 Thunderbird 電子郵件客戶端 ( 中文版 )
sudo apt-get install gaim
# 安裝 GAIM 即時通訊軟體
sudo apt-get install pidgin
# 安裝 Pidgin 即時通訊軟體 ( Ubuntu 9.04 以前內建 )
sudo apt-get install empathy
# 安裝 Empathy 即時通訊軟體 ( Ubuntu 9.10 以後採用 )
sudo deb http://download.skype.com/linux/repos/debian/ stable non-free
# 加入 Skype 來源套件庫
sudo apt-get update && sudo apt-get install skype
# 同步套件庫清單並安裝 Skype
sudo apt-cache search qt-immodule
# 搜尋對應的 Qt 模組,Skype 輸入中文必裝
sudo apt-get install
# 安裝輸入法 Qt 支援 ( ibus-qt4 or scim-qtimm or gcin-qt4-immodule )
sudo apt-get install ekiga
# SIP 網路語音視訊電話
sudo apt-get install pcmanx-gtk2
# 安裝經典 BBS 連線軟體 ( PCMan )
sudo apt-get install xchat
sudo apt-get install seamonkey-chatzilla
# 安裝 IRC 聊天軟體
sudo apt-get install gftp
# 老牌 FTP 傳輸軟體
sudo apt-get install filezilla
# 新一代 FTP 續傳軟體
sudo apt-get install d4x
# Linux 上的 FlashGet 下載工具
sudo apt-get install azureus
# P2P 下載工具 ( BitTorrent client )
sudo apt-get install transmission
# P2P 下載工具 ( lightweight BitTorrent client )
sudo apt-get install qbittorrent
# P2P 下載工具 ( bittorrent client using libtorrent-rasterbar with a nice Qt4 GUI )
sudo apt-get install amule
# 電驢下載工具
sudo apt-get install mldonkey-server
# 電驢伺服器
2010年1月8日
Ubuntu 透過 ADSL 上網
目前 Ubuntu 的最新發行版 9.10 圖形化介面中的 DSL 撥號程式仍然有 BUG
使用 console 來撥號是唯一使用 ADSL 連線上網的方法。
sudo pppoeconf
# 文字介面 ADSL PPPOE 撥號連線
plog
# 查詢 PPPOE 狀態
sudo poff
# 中斷 PPPOE 連線
sudo pon dsl-provider
# 啟用 PPPOE 連線
使用 console 來撥號是唯一使用 ADSL 連線上網的方法。
sudo pppoeconf
# 文字介面 ADSL PPPOE 撥號連線
plog
# 查詢 PPPOE 狀態
sudo poff
# 中斷 PPPOE 連線
sudo pon dsl-provider
# 啟用 PPPOE 連線
Ubuntu 網路相關指令速記
/etc/network/interfaces
# 設定 IP, netmask, Gateway 或使用 DHCP 網路組態
/etc/hostname
# 主機名稱設定
/etc/resolv.conf
# 設定 DNS 伺服器和本機的網域名稱或網域查詢列表
/etc/hosts
# 建立靜態主機名稱與 IP 對應
sudo apt-get install network-manager-gnome
# 安裝圖形化網路管理介面 ( Gnome )
sudo apt-get install knetworkmanager
# 安裝圖形化網路管理介面 ( KDE )
netstat
# -a 列出所有連線,包含 TCP、UDP 和 Socket 通訊
# -l 列出主機在 Listen 的連線,通常為伺服器軟體
# -n 列出 netstat 時不做 IP 反查,速度較快
# -p 列出使用該連線的軟體名稱和 PID
# -t 列出 TCP 連線
# -u 列出 UDP 連線
ifconfig
# option: netmask, broadcast, mtu, IP address
# add UP or DOWN to enable or disable interface
# ifconfig eth0 hw ether AA:BB:CC:11:22:33 to change MAC address
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0
# 設定固定 IP 與子網路遮罩
sudo route add default gw 192.168.1.254
# 設定預設閘道
route -n
sudo route del -net 0.0.0.0 gw 192.168.0.1
route -n
sudo route add -net default gw 192.168.0.1 dev eth0
route -n
# 移除並新增路由表範例
sudo dhclient eth0
# 在網卡 eth0 上取得 IP, netmask, gateway and DNS
sudo vi /etc/network/interfaces # 設定網路範例
auto lo # 啟用 Loopback 設備。請勿變更!
iface lo inet loopback # 啟用 Loopback 設備。請勿變更!
auto eth0 # 啟用 eth0 網路卡
auto eth1 # 啟用 eth1 網路卡
iface eth0 inet static # 設定 eth0 網卡為固定 IP
address 192.168.1.1 # 設定 IP 位置
netmask 255.255.255.0 # 設定子網路遮罩
gateway 192.168.1.254 # 設定預設閘道
network 192.168.1.0 # 設定網路,可有可無
broadcast 192.168.1.255 # 設定廣播,可有可無
iface eth1 inet dhcp # 設定 eth1 網卡從 DHCP Server 取得 IP
sudo /etc/init.d/networking restart
# 重新啟用網路介面
sudo ifdown eth0
# 關閉 eth0 裝置
sudo ifup eth0
# 啟用 eth0 裝置並從 interfaces 讀取設定檔
sudo vi /etc/resolv.conf 編輯 resolv.conf 設定檔
nameserver 8.8.8.8 # 第一台 DNS 主機
nameserver 8.8.4.4 # 第二台 DNS 主機
search yzu.edu.tw edu.tw
# 網域優先搜尋。假設 ping www 或連線 www 則會自動嘗試 DNS 正解 www.yzu.edu.tw,若存在則直接回傳 IP 位置,若不存在則再嘗試 www.edu.tw。故連線同網域主機常常用到。缺點是若要連線 www.gmail.com 則首先會嘗試 DNS 正解 www.gmail.com.yzu.edu.tw,然後依序查詢下去,導致效能低落。
domain yzu.edu.tw
# 用法幾乎與 search 一樣,不過他只能設定一個,也就是主機本身的網域,不能含有其他。查詢的規則和 search 一樣,會把查詢的網址加上 domain 後所設定的網域,最後才會查詢到您的網址。
sudo vi /etc/hostname
# 設定主機名稱
sudo hostname -F /etc/hostname
# 立即更新系統 hostname
hostname -f
# 查詢系統的 FQDN ( 出錯時通常為 hosts 或 resolv.conf 沒設定好 )
# 設定 IP, netmask, Gateway 或使用 DHCP 網路組態
/etc/hostname
# 主機名稱設定
/etc/resolv.conf
# 設定 DNS 伺服器和本機的網域名稱或網域查詢列表
/etc/hosts
# 建立靜態主機名稱與 IP 對應
sudo apt-get install network-manager-gnome
# 安裝圖形化網路管理介面 ( Gnome )
sudo apt-get install knetworkmanager
# 安裝圖形化網路管理介面 ( KDE )
netstat
# -a 列出所有連線,包含 TCP、UDP 和 Socket 通訊
# -l 列出主機在 Listen 的連線,通常為伺服器軟體
# -n 列出 netstat 時不做 IP 反查,速度較快
# -p 列出使用該連線的軟體名稱和 PID
# -t 列出 TCP 連線
# -u 列出 UDP 連線
ifconfig
# option: netmask, broadcast, mtu, IP address
# add UP or DOWN to enable or disable interface
# ifconfig eth0 hw ether AA:BB:CC:11:22:33 to change MAC address
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0
# 設定固定 IP 與子網路遮罩
sudo route add default gw 192.168.1.254
# 設定預設閘道
route -n
sudo route del -net 0.0.0.0 gw 192.168.0.1
route -n
sudo route add -net default gw 192.168.0.1 dev eth0
route -n
# 移除並新增路由表範例
sudo dhclient eth0
# 在網卡 eth0 上取得 IP, netmask, gateway and DNS
sudo vi /etc/network/interfaces # 設定網路範例
auto lo # 啟用 Loopback 設備。請勿變更!
iface lo inet loopback # 啟用 Loopback 設備。請勿變更!
auto eth0 # 啟用 eth0 網路卡
auto eth1 # 啟用 eth1 網路卡
iface eth0 inet static # 設定 eth0 網卡為固定 IP
address 192.168.1.1 # 設定 IP 位置
netmask 255.255.255.0 # 設定子網路遮罩
gateway 192.168.1.254 # 設定預設閘道
network 192.168.1.0 # 設定網路,可有可無
broadcast 192.168.1.255 # 設定廣播,可有可無
iface eth1 inet dhcp # 設定 eth1 網卡從 DHCP Server 取得 IP
sudo /etc/init.d/networking restart
# 重新啟用網路介面
sudo ifdown eth0
# 關閉 eth0 裝置
sudo ifup eth0
# 啟用 eth0 裝置並從 interfaces 讀取設定檔
sudo vi /etc/resolv.conf 編輯 resolv.conf 設定檔
nameserver 8.8.8.8 # 第一台 DNS 主機
nameserver 8.8.4.4 # 第二台 DNS 主機
search yzu.edu.tw edu.tw
# 網域優先搜尋。假設 ping www 或連線 www 則會自動嘗試 DNS 正解 www.yzu.edu.tw,若存在則直接回傳 IP 位置,若不存在則再嘗試 www.edu.tw。故連線同網域主機常常用到。缺點是若要連線 www.gmail.com 則首先會嘗試 DNS 正解 www.gmail.com.yzu.edu.tw,然後依序查詢下去,導致效能低落。
domain yzu.edu.tw
# 用法幾乎與 search 一樣,不過他只能設定一個,也就是主機本身的網域,不能含有其他。查詢的規則和 search 一樣,會把查詢的網址加上 domain 後所設定的網域,最後才會查詢到您的網址。
sudo vi /etc/hostname
# 設定主機名稱
sudo hostname -F /etc/hostname
# 立即更新系統 hostname
hostname -f
# 查詢系統的 FQDN ( 出錯時通常為 hosts 或 resolv.conf 沒設定好 )
2010年1月7日
Ubuntu 最佳化網路卡 MTU 與關掉 IPv6
這篇可能需要稍微要有 TCP / IP 與 OSI 七層模型的基礎,還有網路傳輸基本概念,可能才會比較清楚自己在改些什麼。
sudo ifconfig eth0 mtu 9000
# 修改 eth0 網卡的 MTU 為 9000
ping -c 1 -s -M do
# -M do 在 ICMP 上標示不要 Fragmentation。路由器就不會切割封包
# -s 參數為 ICMP payload 大小,值為 MTU 剪掉 ICMP 表頭大小 28
# 若 MTU 大小為 1500 則 payload byte 就是 1472
將 MTU 值寫入開機設定檔
sudo vi /etc/network/interfaces # 編輯網路設定檔
iface eth0 inet static # 設定 eth0 網路卡為固定 IP
pre-up /sbin/ifconfig eth0 mtu 9000 # 設定 eth0 MTU
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
iface eth1 inet dhcp # 設定 eth1 網路卡為 DHCP
pre-up /sbin/ifconfig eth1 mtu 9000 # 設定 eth1 MTU
關閉 IPv6 支援
sudo vi /etc/modprobe.d/blacklist
加入 blacklist ipv6 即可
sudo ifconfig eth0 mtu 9000
# 修改 eth0 網卡的 MTU 為 9000
ping -c 1 -s
# -M do 在 ICMP 上標示不要 Fragmentation。路由器就不會切割封包
# -s 參數為 ICMP payload 大小,值為 MTU 剪掉 ICMP 表頭大小 28
# 若 MTU 大小為 1500 則 payload byte 就是 1472
將 MTU 值寫入開機設定檔
sudo vi /etc/network/interfaces # 編輯網路設定檔
iface eth0 inet static # 設定 eth0 網路卡為固定 IP
pre-up /sbin/ifconfig eth0 mtu 9000 # 設定 eth0 MTU
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
iface eth1 inet dhcp # 設定 eth1 網路卡為 DHCP
pre-up /sbin/ifconfig eth1 mtu 9000 # 設定 eth1 MTU
關閉 IPv6 支援
sudo vi /etc/modprobe.d/blacklist
加入 blacklist ipv6 即可
訂閱:
文章 (Atom)





