2014年12月22日 星期一

EXSI 5.5 轉移Linux 網卡啟動失敗 Device eth0 does not seem to be present, delaying initialization

 因為原先的EXSI 5.5的伺服器硬體掛點了,所以又複製一台 Linux 虛擬主機,結果開機後發現網路卡未啟動,執行 ifup eth0 出現下列訊息。

# ifup eth0
Device eth0 does not seem to be present, delaying initialization.
 經查詢發現因為"再製"出來的虛擬機會變更新的 MAC Address,所以造成 Linux 判斷成另一張網卡

下列兩種方法任選一種就可以解決。

方法一:
 (1) 我們可以先用下列指令查看系統目前抓到哪幾張網卡
 # cat /proc/net/dev
 Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:       0        0    0    0    0     0          0         0        0        0    0    0    0     0       0          0
  eth1:     0        0    0    0    0     0          0         0        0        0    0    0    0     0       0          0
 這裡可以發現網卡代號已經變成 eth1

 (2) 編輯 /etc/udev/rules.d/70-persistent-net.rules
 # vi /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:37", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:f9:39", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

 可以將 eth1 修改為 eth0,重新開機。


 3) 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0
 # vi /etc/sysconfig/network-scripts/ifcfg-eth0
 將"HWADDR="參數修改成正確的 MAC Address,或刪除此參數,若沒有這個參數應該在上一個步驟重新開機後會自動啟動網卡。

 4) 修改完成後,就可以順利啟動網卡。
 # ifup eth0


方法二:
 (1) 我們可以先用下列指令查看系統目前抓到哪幾張網卡
 # cat /proc/net/dev
 Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 這裡可以發現網卡代號已經變成 eth1

 (2) 編輯 /etc/sysconfig/network-scripts/ifcfg-eth0
 # vi /etc/sysconfig/network-scripts/ifcfg-eth0
 DEVICE=eth0 -> 修改為 DEVICE=eth1
 HWADDR= -> 刪除或修改成正確的 MAC Address

 3) 因為裝置名稱已變更,所以 ifcfg-eth0 也要跟著更名
 # mv ifcfg-eth0 ifcfg-eth1

 4) 修改完成後,就可以順利啟動網卡。
 # ifup eth1

資料來源 Gavin's Linux學習手札

2014年8月12日 星期二

FreeBSD VMware Tools 原廠手冊安裝版


For FreeBSD virtual machines, you manually install or upgrade VMware Tools by using the command line.

Install the latest version of VMware Tools to enhance the performance of the virtual machine's guest operating system and improve virtual machine management. When you power on a virtual machine, if a new version of VMware Tools is available, you see a notification in the status bar of the guest operating system.

Power on the virtual machine.
Verify that the guest operating system is running.
Because the VMware Tools installer is written in Perl, verify that Perl is installed in the guest operating system.
For vSphere virtual machines, to determine whether you have the latest version of VMware Tools, in the vSphere Client inventory, select the virtual machine and click the Summary tab.

1

Select the menu command to mount the VMware Tools virtual disc on the guest operating system.

VMware Product
Menu Command
vSphere Client
Inventory > Virtual Machine > Guest > Install/Upgrade VMware Tools
vSphere Web Client
All Actions icon > Configuration > Install/Upgrade VMware Tools
Fusion
Virtual Machine > Install (or Upgrade) VMware Tools
Workstation
VM > Manage > Install (or Upgrade) VMware Tools
Player
Virtual Machine > Install (or Upgrade) VMware Tools
2

In the virtual machine, log in to the guest operating system as root and open a terminal window.
3

If the distribution does not automatically mount CD-ROMs, mount the VMware Tools virtual CD-ROM image.
For example, type mount /cdrom.
4

Change to a working directory (for example, /tmp).
cd /tmp
5

Untar the VMware Tools tar file.
tar zxpf /cdrom/vmware-freebsd-tools.tar.gz
6

If the distribution does not use automounting, unmount the VMware Tools virtual CD-ROM image.
umount /cdrom
7

Run the installer and configure VMware Tools.
cd vmware-tools-distrib
./vmware-install.pl
Usually, the vmware-config-tools.pl configuration file runs after the installer file finishes running.
8

Respond to the prompts by pressing Enter to accept the default values, if appropriate for your configuration.
9

Follow the instructions at the end of the script.
Depending on the features you use, these instructions can include restarting the X session, restarting networking, logging in again, and starting the VMware User process. You can alternatively reboot the guest operating system to accomplish all these tasks.

If you are using vCenter Server, the VMware Tools label on the Summary tab changes to OK.

資料來源 vSphere 

FreeBSD ZFS修正

由於伺服器的記憶體大於8GB,所以系統會一直出現下面的訊息
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;gdns2 kernel: to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.

要求在/boot/loader.conf檔案裡新增一行
vfs.zfs.prefetch_disable=0
重新開機就可以了。

Extreme Core Switch Command

(1) enable ipforwarding 功能

(功能說明)允許VLAN是否可以forwarding到別的VLAN,如果不啟用就只能在自己的VLAN下使用,無法跟別的VLAN互通。

(使用說明)
# enable ipforwarding --> 全部的VLAN啟用 ipforwarding 功能
#enable ipforwarding vlan "vlan_name" --> 啟用單一個VLAN ipforwarding 功能
=====================================================================
(2) configure iproute 功能

(功能說明)增加/刪除某一個IP網段的路由到另一個網段的功能或設定default route。

(使用說明)
# configure iproute add 10.1.1.0/24  123.45.67.1    --> 增加某一個IP網段的路由功能
# configure iproute delete 10.1.1.0/24  123.45.67.1 --> 刪除某一個IP網段的路由功能
# configure iproute add default 10.1.1.0 --> 設定預設路由(default route)功能
=====================================================================
(3) configure bootprelay 功能

(功能說明)設定DHCP Relay功能。

(使用說明)
# configure bootprelay add 10.1.1.1   --> 設定 DHCP Server IP
# enable bootprelay all --> 設定全部的VLAN都可以使用 DHCP Relay
# enable bootprelay vlan "vlan_name" --> 設定某一個 VLAN 可以使用 DHCP Relay
=====================================================================


變更Outlook 2010 [附件] 資料夾設定為不同的位置

  1. 按一下 [開始],然後按一下 [執行]。
  2. 在 [開啟] 方塊中,輸入regedit,然後按一下[確定]
  3. 找出下列登錄機碼:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  4. 在右邊視窗按兩下 [Personal]-->修改。
  5. 將值變更為您想要的路徑。例如:
    預設是 %USERPROFILE%\Documents 的附件,會將位置設至我的附件資料夾。
    改為E:\。
  6. 按一下 [登錄] 功能表的 [結束]。
  7. 重新啟動 Outlook。
當您開啟新的電子郵件附加檔案時,[插入檔案] 對話方塊會開啟您指定的資料夾。

資訊來源:微軟技術網站

2014年7月8日 星期二

FreeBSD Pkg 指令

可以用從本機上或者透過網路來安裝任一 FreeBSD package。

若手邊沒有 package 來源(像是 FreeBSD 光碟)的話, 那麼建議使用 pkg_add(1) 時,
加上【 -r 】 選項來更輕鬆安裝 package。如此一來,就會自動判斷正確的 package 格式、 以及所搭配的作業系統 release 版本, 然後會自己從 FTP 站抓回、安裝相對應的 package。
# pkg_add -r lsof

上面這例子會自動下載正確的 package 並安裝。 若想改換用其他 FreeBSD Packages Mirror 站,那麼就要設定PACKAGESITE 環境變數, 如此一來才會取代預設設定。 pkg_add(1) 會用 fetch(3) 指令來下載檔案,而 fetch(3) 本身則會使用相關環境變數的設定, 像是: FTP_PASSIVE_MODEFTP_PROXY 以及 FTP_PASSWORD。 如果你網路環境處於 firewall 後面,或者需要用 FTP/HTTP proxy 的話,那麼就需要設定。 設定細節請參閱 fetch(3)。 請注意:上面所說的例子是寫 lsof 而非 lsof-4.56.4。 當使用遠端抓取功能時,該 package 版號就不必加上去了。 pkg_add(1) 會自動下載該軟體的最新版回來安裝。

perl安裝:pkg_add -r perl
compat6x-amd64安裝:pkg_add -r compat6x-amd64
wget安裝:pkg_add -r wget

舊的 pkg_* 工具會在 2014/09/01 正式停止支援。

Windows DNS Nslookup 預設伺服器:Unknown

最近客戶的DNS會有 nslookup指令後,會出現 預設伺服器:unknown,的問題

C:\Users\Administrator>nslookup
預設伺服器:  UnKnown
Address:  168.1.1.1


問題解決是因為DNS伺服器的IP反解未加入,所以就會出現找不到伺服器名稱,加入後就正常了。


資料來源:Randika