ubuntu server 18.04 ipv6 設定? [論壇 - 伺服器架設]
正在瀏覽:
1 名遊客
ubuntu server 18.04 ipv6 設定? |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2009/4/10 9:11 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 18
![]() |
在網路上查到如下
ens33: dhcp4: no dhcp6: no addresses: [192.168.1.2/24, '2001:1::2/64'] gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8,8.8.4.4] 這是正確的嗎?沒有看到 gateway6: 不用嗎?請指點,疑惑中... 找到答案了 ens33: dhcp4: false dhcp6: false addresses: [192.168.1.2/24, '2001:1::2/64'] gateway4: 192.168.1.1 gateway6: 2001:1::ff nameservers: addresses: [8.8.8.8,8.8.4.4]
2018/9/6 17:20
|
||||||||||
![]() |
回覆: ubuntu server 18.04 ipv6 設定? |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 901
![]() |
小王 寫到: 關於IPv6的設定,我並不懂,先貼一下剛找到的參考網址, 也許您研究了,您有心得,可以來分享怎麼設定,感恩先 我先從「Ubuntu Server Guide」, 找到「Networking」, 接著找到「Network Configuration」, 接著找到「netplan man page」, 然後使用「IPv6」當關鍵字,可以找到相關的說明,有您提到的「gateway6」的範例。 addresses (sequence of scalars) Add static addresses to the interface in addition to the ones received through DHCP or RA. Each sequence entry is in CIDR notation, i. e. of the form addr/prefixlen. addr is an IPv4 or IPv6 address as recognized by inet_pton(3) and prefixlen the number of bits of the subnet. Example: addresses: [192.168.14.2/24, "2001:1::1/64"] gateway4, gateway6 (scalar) Set default gateway for IPv4/6, for manual address configuration. This requires setting addresses too. Gateway IPs must be in a form recognized by inet_pton(3). Example for IPv4: gateway4: 172.16.0.1 Example for IPv6: gateway6: "2001:4::1" 也可以執行指令下面指令,來閱讀「netplan man page」
或是查詢「ubuntu 18.04 ipv6」, 查到兩篇參考文章,「1」,「2」, 裡面都有提到是參考「這篇」,對照您提供的範例,猜測您應該也是參考「這篇」。 以上提供參考,我還沒實際去測試,只是先貼出來找到的參考資料 ![]() ## netplan 相關網址 * https://netplan.io/ * https://netplan.io/examples * https://github.com/CanonicalLtd/netplan * https://github.com/CanonicalLtd/netplan/tree/master/doc * https://github.com/CanonicalLtd/netplan/blob/master/doc/example-config ## yaml * http://yaml.org/ * https://zh.wikipedia.org/zh-tw/YAML ## 簡易套件探索 執行
顯示
執行
顯示
執行
顯示
執行
顯示
執行下面指令,觀看「/usr/share/doc/netplan.io/netplan.html」
或是執行下面指令,觀看「/usr/share/doc/netplan.io/netplan.html」
或是執行下面指令,觀看「/usr/share/doc/netplan.io/netplan.html」
執行
顯示
執行下面指令,觀看「netplan.io」這個套件的相關資訊。
顯示 Package: netplan.io Architecture: amd64 Version: 0.36.3 Multi-Arch: foreign Priority: important Section: net Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 228 Provides: nplan Depends: libc6 (>= 2.27), libglib2.0-0 (>= 2.16.0), libuuid1 (>= 2.16), libyaml-0-2, python3, python3-yaml, systemd (>= 235-3ubuntu3) Suggests: network-manager | wpasupplicant Conflicts: netplan Breaks: network-manager (<< 1.2.2-0ubuntu4~), nplan (<< 0.34~) Replaces: nplan (<< 0.34~) Filename: pool/main/n/netplan.io/netplan.io_0.36.3_amd64.deb Size: 58880 MD5sum: 822bcc74e5c6c25e23cc7206cf99d4d6 SHA1: dfb4e619481bb85e116992fc8087fb76d1c099b7 SHA256: eae6d963cb161ece2b7ec04ebec6f150303b21d4b5bdd3f87e75e329727c079a Description-en: YAML network configuration abstraction for various backends netplan reads YAML network configuration files which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot it then generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon. . Currently supported backends are networkd and NetworkManager. Description-md5: 171990596b9adbbde53590d783767a6d Task: minimal, ubuntu-core Supported: 5y ## 「Binary Package: netplan.io」 執行下面指令,下載「Binary Package: netplan.io」。
會下載一個檔案「netplan.io_0.36.3_amd64.deb」 執行下面指令,解開「netplan.io_0.36.3_amd64.deb」
會解開到資料夾「netplan.io」 執行下面指令,觀看「netplan.io」這個資料夾結構
顯示 netplan.io ├── etc │ └── netplan ├── lib │ ├── netplan │ │ └── generate │ └── systemd │ ├── system │ │ └── netplan-wpa@.service │ └── system-generators │ └── netplan -> ../../netplan/generate └── usr ├── sbin │ └── netplan -> ../share/netplan/netplan.script └── share ├── bash-completion │ └── completions │ └── netplan ├── doc │ └── netplan.io │ ├── changelog.gz │ ├── copyright │ ├── examples │ │ ├── bonding_router.yaml │ │ ├── bonding.yaml │ │ ├── bridge_vlan.yaml │ │ ├── bridge.yaml │ │ ├── dhcp.yaml │ │ ├── direct_connect_gateway.yaml │ │ ├── loopback_interface.yaml │ │ ├── network_manager.yaml │ │ ├── source_routing.yaml │ │ ├── static_multiaddress.yaml │ │ ├── static.yaml │ │ ├── vlan.yaml │ │ ├── windows_dhcp_server.yaml │ │ └── wireless.yaml │ └── netplan.html ├── man │ └── man5 │ └── netplan.5.gz └── netplan ├── netplan │ ├── cli │ │ ├── commands │ │ │ ├── apply.py │ │ │ ├── generate.py │ │ │ ├── __init__.py │ │ │ ├── ip.py │ │ │ ├── migrate.py │ │ │ └── try_command.py │ │ ├── core.py │ │ ├── __init__.py │ │ └── utils.py │ ├── configmanager.py │ ├── __init__.py │ └── terminal.py └── netplan.script 21 directories, 36 files 執行下面指令,顯示「netplan.io」這個資料夾裡的檔案列表
顯示
或是加上「sort」,也就是執行下面指令
顯示
執行下面指令,解開「Control File」和「MaintainerScripts」
會解開到資料夾「DEBIAN」 執行下面指令,觀看「DEBIAN」這個資料夾結構
顯示 DEBIAN ├── control ├── md5sums └── postinst 0 directories, 3 files 執行
顯示
執行
顯示
* 「DEBIAN/postinst」<=> 「/var/lib/dpkg/info/netplan.io.postinst」 * 「DEBIAN/md5sums」<=> 「//var/lib/dpkg/info/netplan.io.md5sums」 執行
顯示 Package: netplan.io Architecture: amd64 Version: 0.36.1 Multi-Arch: foreign Priority: important Section: net Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 228 Provides: nplan Depends: libc6 (>= 2.27), libglib2.0-0 (>= 2.16.0), libuuid1 (>= 2.16), libyaml-0-2, python3, python3-yaml, systemd (>= 235-3ubuntu3) Suggests: network-manager | wpasupplicant Conflicts: netplan Breaks: network-manager (<< 1.2.2-0ubuntu4~), nplan (<< 0.34~) Replaces: nplan (<< 0.34~) Filename: pool/main/n/netplan.io/netplan.io_0.36.1_amd64.deb Size: 58384 MD5sum: efc46878b6ab0b096545292d0bebe4b7 SHA1: 7761a00dff7125a9ba21a6aeee77db857f0d6bb6 SHA256: 0f1fc02f7c4c9f9caf7ba10c394a36f0ab7d3e530310f779ca30a8eb1747356e Description: YAML network configuration abstraction for various backends Task: minimal, ubuntu-core Description-md5: 171990596b9adbbde53590d783767a6d Supported: 5y 執行
顯示 Package: netplan.io Status: install ok installed Priority: important Section: net Installed-Size: 228 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Architecture: amd64 Multi-Arch: foreign Version: 0.36.3 Replaces: nplan (<< 0.34~) Provides: nplan Depends: libc6 (>= 2.27), libglib2.0-0 (>= 2.16.0), libuuid1 (>= 2.16), libyaml-0-2, python3, python3-yaml, systemd (>= 235-3ubuntu3) Suggests: network-manager | wpasupplicant Breaks: network-manager (<< 1.2.2-0ubuntu4~), nplan (<< 0.34~) Conflicts: netplan Description: YAML network configuration abstraction for various backends netplan reads YAML network configuration files which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot it then generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon. . Currently supported backends are networkd and NetworkManager. 執行
顯示
執行
顯示 Package: netplan.io Architecture: amd64 Version: 0.36.1 Multi-Arch: foreign Priority: important Section: net Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 228 Provides: nplan Depends: libc6 (>= 2.27), libglib2.0-0 (>= 2.16.0), libuuid1 (>= 2.16), libyaml-0-2, python3, python3-yaml, systemd (>= 235-3ubuntu3) Suggests: network-manager | wpasupplicant Conflicts: netplan Breaks: network-manager (<< 1.2.2-0ubuntu4~), nplan (<< 0.34~) Replaces: nplan (<< 0.34~) Filename: pool/main/n/netplan.io/netplan.io_0.36.1_amd64.deb Size: 58384 MD5sum: efc46878b6ab0b096545292d0bebe4b7 SHA1: 7761a00dff7125a9ba21a6aeee77db857f0d6bb6 SHA256: 0f1fc02f7c4c9f9caf7ba10c394a36f0ab7d3e530310f779ca30a8eb1747356e Description: YAML network configuration abstraction for various backends Task: minimal, ubuntu-core Description-md5: 171990596b9adbbde53590d783767a6d Supported: 5y 執行
顯示 Package: netplan.io Architecture: amd64 Version: 0.36.3 Multi-Arch: foreign Priority: important Section: net Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 228 Provides: nplan Depends: libc6 (>= 2.27), libglib2.0-0 (>= 2.16.0), libuuid1 (>= 2.16), libyaml-0-2, python3, python3-yaml, systemd (>= 235-3ubuntu3) Suggests: network-manager | wpasupplicant Conflicts: netplan Breaks: network-manager (<< 1.2.2-0ubuntu4~), nplan (<< 0.34~) Replaces: nplan (<< 0.34~) Filename: pool/main/n/netplan.io/netplan.io_0.36.3_amd64.deb Size: 58880 MD5sum: 822bcc74e5c6c25e23cc7206cf99d4d6 SHA1: dfb4e619481bb85e116992fc8087fb76d1c099b7 SHA256: eae6d963cb161ece2b7ec04ebec6f150303b21d4b5bdd3f87e75e329727c079a Description: YAML network configuration abstraction for various backends Task: minimal, ubuntu-core Description-md5: 171990596b9adbbde53590d783767a6d Supported: 5y 執行
顯示 Package: netplan.io Description-md5: 171990596b9adbbde53590d783767a6d Description-en: YAML network configuration abstraction for various backends netplan reads YAML network configuration files which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot it then generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon. . Currently supported backends are networkd and NetworkManager. 執行
顯示 Package: netplan.io Description-md5: 171990596b9adbbde53590d783767a6d Description-en: YAML network configuration abstraction for various backends netplan reads YAML network configuration files which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot it then generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon. . Currently supported backends are networkd and NetworkManager. ## 「Source Package: netplan.io」 執行下面指令,下載「Source Package: netplan.io」。
會下載下面兩個檔案 * netplan.io_0.36.3.dsc * netplan.io_0.36.3.tar.xz 並且解開到「netplan.io-0.36.3」這個資料夾 執行下面指令
觀看「netplan.io-0.36.3」這個資料夾結構 netplan.io-0.36.3 ├── COPYING ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── dirs │ ├── docs │ ├── netplan.io.install │ ├── postinst │ ├── rules │ ├── source │ │ └── format │ └── tests │ ├── autostart │ └── control ├── doc │ ├── example-config │ ├── manpage.md │ └── netplan.md ├── examples │ ├── bonding_router.yaml │ ├── bonding.yaml │ ├── bridge_vlan.yaml │ ├── bridge.yaml │ ├── dhcp.yaml │ ├── direct_connect_gateway.yaml │ ├── loopback_interface.yaml │ ├── network_manager.yaml │ ├── source_routing.yaml │ ├── static_multiaddress.yaml │ ├── static.yaml │ ├── vlan.yaml │ ├── windows_dhcp_server.yaml │ └── wireless.yaml ├── Makefile ├── netplan │ ├── cli │ │ ├── commands │ │ │ ├── apply.py │ │ │ ├── generate.py │ │ │ ├── __init__.py │ │ │ ├── ip.py │ │ │ ├── migrate.py │ │ │ └── try_command.py │ │ ├── core.py │ │ ├── __init__.py │ │ └── utils.py │ ├── configmanager.py │ ├── __init__.py │ └── terminal.py ├── netplan.completions ├── README.md ├── rpm │ └── netplan.spec ├── src │ ├── generate.c │ ├── netplan.script │ ├── netplan-wpa@.service │ ├── networkd.c │ ├── networkd.h │ ├── nm.c │ ├── nm.h │ ├── parse.c │ ├── parse.h │ ├── util.c │ └── util.h └── tests ├── cli.py ├── generate.py ├── integration.py ├── test_configmanager.py └── test_terminal.py 11 directories, 62 files 執行下面指令,顯示「netplan.io-0.36.3」這個資料夾裡的檔案列表
顯示
或是加上「sort」,也就是執行下面指令
顯示
執行
顯示 Package: netplan.io Format: 3.0 (native) Binary: netplan.io, nplan Architecture: any all Version: 0.36.1 Priority: important Section: net Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Standards-Version: 4.1.3 Build-Depends: debhelper (>= 11), pkg-config, bash-completion, libyaml-dev, libglib2.0-dev, uuid-dev, python3 (>= 3.1), python3-coverage, python3-yaml, systemd, pyflakes3, pycodestyle | pep8, python3-nose, pandoc Testsuite: autopkgtest Vcs-Browser: https://github.com/CanonicalLtd/netplan Vcs-Git: https://github.com/CanonicalLtd/netplan Directory: pool/main/n/netplan.io Package-List: netplan.io deb net important arch=any nplan deb oldlibs optional arch=all Files: 629d49231c86a718579ca0e92ed79c59 1854 netplan.io_0.36.1.dsc d9e24f58373f9f32f8f2c17ca61ac41f 81184 netplan.io_0.36.1.tar.xz Checksums-Sha1: 31cfd10bb5bae9dce25b71faca7dea7788104364 1854 netplan.io_0.36.1.dsc 18ea2c6d4c530c57818162452d5b03ed1b6465e6 81184 netplan.io_0.36.1.tar.xz Checksums-Sha256: f9f70cf67c41f8b7bdb6a0c9fe864772727496daef8fe587930d9430eb0448b6 1854 netplan.io_0.36.1.dsc db199e0c278fe534f9b63d08faab9fe5d4f86c7e9a105789db519493f255ec5b 81184 netplan.io_0.36.1.tar.xz Testsuite-Triggers: dnsmasq-base, hostapd, network-manager, systemd 執行
顯示
執行
顯示 Package: netplan.io Format: 3.0 (native) Binary: netplan.io, nplan Architecture: any all Version: 0.36.1 Priority: important Section: net Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Standards-Version: 4.1.3 Build-Depends: debhelper (>= 11), pkg-config, bash-completion, libyaml-dev, libglib2.0-dev, uuid-dev, python3 (>= 3.1), python3-coverage, python3-yaml, systemd, pyflakes3, pycodestyle | pep8, python3-nose, pandoc Testsuite: autopkgtest Vcs-Browser: https://github.com/CanonicalLtd/netplan Vcs-Git: https://github.com/CanonicalLtd/netplan Directory: pool/main/n/netplan.io Package-List: netplan.io deb net important arch=any nplan deb oldlibs optional arch=all Files: 629d49231c86a718579ca0e92ed79c59 1854 netplan.io_0.36.1.dsc d9e24f58373f9f32f8f2c17ca61ac41f 81184 netplan.io_0.36.1.tar.xz Checksums-Sha1: 31cfd10bb5bae9dce25b71faca7dea7788104364 1854 netplan.io_0.36.1.dsc 18ea2c6d4c530c57818162452d5b03ed1b6465e6 81184 netplan.io_0.36.1.tar.xz Checksums-Sha256: f9f70cf67c41f8b7bdb6a0c9fe864772727496daef8fe587930d9430eb0448b6 1854 netplan.io_0.36.1.dsc db199e0c278fe534f9b63d08faab9fe5d4f86c7e9a105789db519493f255ec5b 81184 netplan.io_0.36.1.tar.xz Testsuite-Triggers: dnsmasq-base, hostapd, network-manager, systemd 執行
顯示 Package: netplan.io Format: 3.0 (native) Binary: netplan.io, nplan Architecture: any all Version: 0.36.3 Priority: important Section: net Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Standards-Version: 4.1.3 Build-Depends: debhelper (>= 11), pkg-config, bash-completion, libyaml-dev, libglib2.0-dev, uuid-dev, python3 (>= 3.1), python3-coverage, python3-yaml, systemd, pyflakes3, pycodestyle | pep8, python3-nose, pandoc Testsuite: autopkgtest Vcs-Browser: https://github.com/CanonicalLtd/netplan Vcs-Git: https://github.com/CanonicalLtd/netplan Directory: pool/main/n/netplan.io Package-List: netplan.io deb net important arch=any nplan deb oldlibs optional arch=all Files: ef5f37c2e144988c73cd47fd4218b57f 1854 netplan.io_0.36.3.dsc 09c4097df48ce6ed4a0663e54febe9f8 82076 netplan.io_0.36.3.tar.xz Checksums-Sha1: 4f0c0a626e7fb13dd363846024237956167104bb 1854 netplan.io_0.36.3.dsc 8a3c8e52bae7762cc10a23bce3461a306053368c 82076 netplan.io_0.36.3.tar.xz Checksums-Sha256: a78cb6f12de2c96eae5d608d56bd622bc4160766f112d03358bd8d17c610d731 1854 netplan.io_0.36.3.dsc 405d17cf1f233ee7d03d7b0ab5508626e7e7d98fcb5a9b9b5544001edc5ca91f 82076 netplan.io_0.36.3.tar.xz Testsuite-Triggers: dnsmasq-base, hostapd, network-manager, systemd
2018/9/7 18:30
|
||||||||||
![]() |
回覆: ubuntu server 18.04 ipv6 設定? |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員三級
![]() ![]() 註冊日期:
2012/4/26 9:45 所屬群組:
已註冊使用者 等級: 12
HP : 0 / 293
![]() |
addresses: [8.8.8.8,8.8.4.4] ==> 這個是DNS吧?
兩個都是addresses:,應該有點問題。 不過這一行是ipv4的ip。
2018/9/14 1:47
|
||||||||||
![]() |
回覆: ubuntu server 18.04 ipv6 設定? |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 901
![]() |
redhung 寫到: 關於您提的疑問,因為顯示的時候,縮格不見了, 原本樓主的是 小王 寫到: 我重新設定「BBCode,加入「[ code ] [ / code ]」,顯示就會有縮格。 小王 寫到: 轉成「json」的格式,如下 { "ens33": { "dhcp4": "no", "dhcp6": "no", "addresses": [ "192.168.1.2/24", "2001:1::2/64" ], "gateway4": "192.168.1.1", "nameservers": { "addresses": [ "8.8.8.8", "8.8.4.4" ] } } } 應該可以解答您的疑問 redhung 寫到: 可以執行「$ man netplan 」觀看最下方的「Examples」 還有可以參考「Wikipedia / YAML」,了解「yaml」的格式。 上面「#2」我有列這些參考連結。 或是也可以到「https://learnxinyminutes.com/」,找到「yaml」來參考,可以用關鍵字「a_nested_map」找尋該頁面。 以上提供參考, 報告完畢 ![]()
2018/9/14 6:31
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.