Quantcast
Channel: Hardware – Benjr.tw
Viewing all articles
Browse latest Browse all 145

IPV6 NFS

$
0
0

在還沒有開始 IPv6 NFS Server 前,先來看看 IPv6 的 IP Address 是怎麼運作的.

一般網卡在啟動時就會指派一組 IPV6 link-local address,而這 link-local address 是唯一的而且是依據網卡的 MAC Address 而有所變動

比如 :
MAC Address – 00:1A:64:22:04:83
link-local address – fe80::21a:64ff:fe22:483
IPV6 長度為 128bits 而 MAC 長度為 48bits 要怎麼轉換呢!!

首先 MAC Address 的第五位元組與第四位元組插入 FF:FE
原 MAC Address 第6位元組的第二個 bit 從原來的 “0″轉成 “1″,所以 00 -> 02
前面再填入 fe80:0000:0000:0000
fe80:0000:0000:0000:021a:64ff:fe22:0483
寫這麼多 0 一定會寫錯,所以有簡寫的規則,規則如下:

每 32Bit 如開頭之4bit表示為0,即可省略,若32Bit全為0,則可簡寫為0
若連續完整之32Bit段落皆為 0000,則可全省略,簡寫為::,但以一次為限

最後簡寫成為 : fe80::21a:64ff:fe22:483

實驗環境在 Ubuntu 14.04 Desktop ,預設是沒有安裝 NFS Server 與 showmount 等工具

# sudo apt-get install nfs-kernel-server
# sudo apt-get install nfs-common

NFS Server IPv6 addr: fe80::a00:27ff:fee1:66c1/64
Client IPv6 addr: fe80::a00:27ff:fe64:cc37/64
NFS_IPv601
先確定一下 ping , iptables , ip route 這幾件事情都沒有問題.

# ping6 fe80::a00:27ff:fee1:66c1%eth0
# ping6 fe80::a00:27ff:fe64:cc37%eth0
# ip6tables -L
# ip -6 route show
  • NFS Server IPv6: inet6 addr: fe80::a00:27ff:fee1:66c1/64
    設定的方式也跟 IPv4 一樣,不過要改成 IPv6 的 IP 位址.
    # vi /etc/exports
    # /etc/exports: the access control list for filesystems which may be exported
    #               to NFS clients.  See exports(5).
    #
    # Example for NFSv2 and NFSv3:
    # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
    #
    # Example for NFSv4:
    # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
    # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
    #
    /var/ftp/ fe80::a00:27ff:fee1:66c1/64(rw,async,no_root_squash,no_subtree_check)
    
    
    # /etc/init.d/nfs-kernel-server restart
     * Stopping NFS kernel daemon                                            [ OK ]
     * Unexporting directories for NFS kernel daemon...                      [ OK ]
     * Exporting directories for NFS kernel daemon...                        [ OK ]
     * Starting NFS kernel daemon    
    

    fe80::a00:27ff:fee1:66c1/64 Network ID為64bits ,只要是 fe80:0000:0000:0000 開頭的 Clients 都可以使用.

  • Client IPv6: inet6 addr: fe80::a00:27ff:fe64:cc37/64
    要掛載的方式也一樣,不過要改成 IPv6 的 IP 位址
    # showmount -e fe80::a00:27ff:fee1:66c1
    Export list for fe80::a00:27ff:fee1:66c1:
    /var/ftp fe80::a00:27ff:fee1:66c1/64
    # mount -t nfs [fe80::a00:27ff:fee1:66c1]:/var/ftp /mnt
    mount.nfs: mount system call failed
    # mount -t nfs4 [fe80::a00:27ff:fee1:66c1]:/var/ftp /mnt
    mount.nfs4: mount system call failed
    # mount -t nfs4 '[fe80::a00:27ff:fee1:66c1]':/var/ftp /mnt
    mount.nfs4: mount system call failed
    

    無解,不知道為什麼不行.


Viewing all articles
Browse latest Browse all 145

Trending Articles