(ãããã¯ã¼ã¯) GMOã¨ãã¨ãBBã«åãæ¿ãããHGWã ãã§ã¯v6ãã©ã¹éä¿¡ãã§ããªã
ãããã¤ããGMOã¨ãã¨ãBBã®GMOå ã¢ã¯ã»ã¹ã«åãæ¿ãã¾ããã v6ãã©ã¹ã使ãããµã¼ãã¹ã§ãã
ç¾å¨ã®ãããã¤ããv6ãã©ã¹ãå©ç¨ãã¦ãããå ã³ã©ãã ã£ãã®ã§äºæ¥è å¤æ´ã§åãæ¿ãã¾ããã
ãã¦ãééæ¥ã®ç¿æ¥æ¥ä¸ã«çªç¶IPv4ç³»ã®éä¿¡ãåºæ¥ãªããªãã¾ããã
ã©ãããv6ãã©ã¹ã§ã¢ã¯ã»ã¹ã§ããªããªã£ãããã§ãã
v6ãã©ã¹ãã§ãã¯ãµã¤ãã§ç¢ºèªãã¦ãNGã§ããã
http://192.168.1.1:8888/t/ ã«ã¢ã¯ã»ã¹ãã¦ãv6ãã©ã¹ç¨ã®ã½ããã¦ã§ã¢ãé
ä¿¡ããã¦ããªãããã§ããã
ãã£ããPPPoEã§éç¨ãããã¨ã«ããã
ãªãããã®äºè±¡çºçæã®ãããã¯ã¼ã¯ç°å¢ã¯ãããªã£ã¦ãã¾ããã
ISP(VNE) ----- HGW ----- PC
ããã以åã®ãããã¤ãã§v6ãã©ã¹ã®å»æ¢ããªããã¦ããªãã¨ç§»è¡å ã§ä½¿ããªãã¨ããäºãããããã§ãããä»åã¯ééã¡ã¼ã«ãæ¥ã¦ããã®ã§ãã®äºè±¡ã§ã¯ãªããªã¨æãã¾ããã
GMOã«åãåãããã¨ã以ä¸ã®ãããªæè¨ããã
å¼ç¤¾ã®v6ãã©ã¹ã¯ãã«ã¼ã¿ã¼å®ã«ééããã¦ããã¾ããHGWã«ã¦v6ãã©ã¹ããå©ç¨ããã ãããå ´åãv6ãã©ã¹ã移è¡é ä¿¡ããå¿ è¦ããããã¾ãã
ã¤ã¾ããv6ãã©ã¹ã¯HGWãã¤ããããã«ã¼ã¿ã¼ãã¤ãããã§ãããã¤ãå´ã®è¨å®ãå¤ãããã©ãä»åã¯ã«ã¼ã¿ã¼å®ã ããHGWã§ä½¿ããªãã ã¨ããäºã®ããã§ãã
å®é¨ã§ãHGWé ä¸ã«v6ãã©ã¹ã«å¯¾å¿ããã«ã¼ã¿(GMPã®ã¬ã³ã¿ã«å)ãè¨å®ããã¨ã確ãã«v6ãã©ã¹ã§ã®éä¿¡ãã§ããããã«ãªãã¾ããã
ISP(VNE) ----- HGW ----- v6ãã©ã¹å¯¾å¿ã«ã¼ã¿ --- PC âéä¿¡å¯
調ã¹ãã¨v6ãã©ã¹å¯¾å¿ã«ã¼ã¿ã¼ã§ãæ¥ç¶ã§ããªãæã®è½ã¨ãç©´ | ç¡é§ã§ããããããªãã§ããã®ãããã®è©³ããæ
å ±ãè¨è¼ããã¦ãã¾ããã
HGWã§v6ãã©ã¹ã使ãããã«ã¯ããããã¤ãã«ãã®æ¨ãä¾é ¼ãããããããã§ãã
ã§ããä»åã¯ã¬ã³ã¿ã«ã«ã¼ã¿ãHGWã®ä¸ã«ããã¦ã¢ã¯ã»ã¹ãããã¨ã«ããã®ã§ãHGWã¸ã®v6ãã©ã¹ä¾é ¼ã¯è¦éãã¾ããã
ãªããã«ã¼ã¿ã¼å´ã§v6ãã©ã¹ã使ãããã«ãªãã¨ããã®ã«ã¼ã¿ã¯ä»¥ä¸ã®ããã¤ã¹ããHGWã®ç®¡çç»é¢ã¨ãã¯ã¢ã¯ã»ã¹ã§ããªããªãã¾ãã
(AWS) CloudFront ãç½²åä»ãURLã«ããã¢ã¯ã»ã¹å¶éãã
èæ¯
CloudFrontã§å
¬éãã¦ãã³ã³ãã³ãã§ããããããªãã¯ã§ã¯ãªããå¥ã«ãã¹ããã¦ããã°ã¤ã³ãå¿
è¦ãªWebãµã¤ãã®ã³ã³ãã³ããããã¯URLãç¥ã£ã¦ãã¦ã¼ã¶ã¼ããã®ã¿ã¢ã¯ã»ã¹ã§ããããã«ããããã®æ¹æ³ã§ãã
ãããªæã«ä½¿ããã®ãCloudFrontã®ç½²åä»ãURLãç½²åä»ãCookieã§ãã
ãã°ã¤ã³ãå¿ è¦ãªãµã¤ããâ(ç½²åä»ãURL)âãCloudFront ----- S3
ç½²åä»ãURLã®ä»çµã¿ã¯ç½²åä»ã URL ã使ç¨ãã - Amazon CloudFrontã§èª¬æããã¦ãã¾ãã
ç½²åä»ãURLã«ã¯æ¢å®ããªã·ã¼ã¨ã«ã¹ã¿ã ããªã·ã¼ãããã¾ããéãã¯ä¸è¨AWSããã¥ã¡ã³ããµã¤ãã§è§£èª¬ããã¦ãã¾ãããä»åã¯æ¢å®ããªã·ã¼ã¨ãããã¨ã«ãã¾ããã
éµé¢é£ã®ä½æã»ç»é²
(ä½è«)WSLã¤ã³ã¹ãã¼ã«
ç½²åä»ãURLãã¤ããã«ã¯OpenSSLã§ç§å¯éµãå
¬ééµãä½æããå¿
è¦ãããã¾ãããç½²åä»ãURLãä½æããéã«ã¯Perlãã¤ããã¨æ¥½ã§ãã
3æµPGã®ã¡ã¤ã³ç°å¢ã¯Windowsã§ãããä¸è¨ãè¡ãã«ãããLinuxç°å¢ã®ã»ãããµã¯ãã¨ããããã§ãã¾ããã§ããä»®æ³ãã·ã³ã¨ããã¦ãã®é¢åã ãªã¼ã¨æã£ã¦ãã¾ããããä»ã¯WSLã¨ããWindowsä¸ã§ç´æ¥Linuxãå®è¡ã§ãããµãã·ã¹ãã ãããã¾ããä»åã¯WSLã使ããã¨ã«ãã¾ããã(WSLã«ã¯WSL1ã¨WSL2ãããã¾ãããä»åWSL2ã¨ãªãã¾ãã)
WSLã®ã¤ã³ã¹ãã¼ã«ã¯ç°¡åã§ä»¥ä¸ã®ã³ãã³ãã ãã§ãã
wsl --install
/etc/os-releaseãã¡ã¤ã«ãè¦ãã¨ãã¤ã³ã¹ãããããã£ã¹ããªãã¥ã¼ã·ã§ã³ã¯ Ubuntu 22.04.3 LTS ã®ããã§ãã
ãªããWSLãã«ã¼ãã«ã®ãã¼ã¸ã§ã³ã¯Windowsã¿ã¼ããã«ãã以ä¸ã³ãã³ãã§ç¢ºèªã§ãã¾ãã
wsl --version WSL ãã¼ã¸ã§ã³: 2.3.24.0 ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.15.153.1-2 WSLg ãã¼ã¸ã§ã³: 1.0.65 MSRDC ãã¼ã¸ã§ã³: 1.2.5620 Direct3D ãã¼ã¸ã§ã³: 1.611.1-81528511 DXCore ãã¼ã¸ã§ã³: 10.0.26100.1-240331-1435.ge-release Windows ãã¼ã¸ã§ã³: 10.0.22631.4169
ç§å¯éµã¨å ¬ééµã®ä½æ
ä¸è¨WSLç°å¢ã®Linuxã§ã以ä¸ã®ã³ãã³ãã§ç§å¯éµã¨ãããããå ¬ééµãçæãã¾ãã
$ openssl genrsa -out aws_private_key.pem 2048 $ openssl rsa -pubout -in aws_private_key.pem -out aws_public_key.pem
ãªããWSLã®å ´åãWindowså´ããã¯ä»¥ä¸ã®ãããªå ±æãã©ã«ããã¹ã§ã¢ã¯ã»ã¹ã§ãã¾ãã
\\wsl.localhost\Ubuntu\home\user01\
CloudFrontã§ãããªãã¯ãã¼ãç»é²
CloudFrontã®[ãããªãã¯ãã¼]â[ãããªãã¯ãã¼ãä½æ]ãããä¸è¨ã§ä½æããå ¬ééµãç»é²ãã¾ãã
CloudFrontã« ãã¼ã°ã«ã¼ã ãä½æ
CloudFrotã®[ãã¼ã°ã«ã¼ã]â[ãã¼ã°ã«ã¼ããä½æ]ãããä¸è¨ã§ä½æãããããªãã¯ãã¼ãé¸æãã¦ãã¼ã°ã«ã¼ããä½æãã¾ãã
CloudFrontå´ã§ç½²åä»ãURLã¾ãã¯ç½²åä»ãCookieã®ã¿ã¢ã¯ã»ã¹ããããå¶é
CloudFront â [ãã£ã¹ããªãã¥ã¼ã·ã§ã³] â 対象ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ â 対象ã®ããã¤ã㢠ã«ã¦ã[ãã¥ã¼ã¯ã¼ã®ã¢ã¯ã»ã¹ãå¶éãã]ãæå¹ã«ãããã¼ã°ã«ã¼ãã«ä¸è¨ã§ä½æãããã¼ã°ã«ã¼ããè¨å®ãã¾ãã
ããã§ãç½²åä»ãã§ãªãURLã§CloudFrontã®å ¬éãµã¤ãã«ã¢ã¯ã»ã¹ããã¨ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ã表示ãããããã«ãªãã¾ãã
This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>MissingKey</Code> <Message>Missing Key-Pair-Id query parameter or cookie value</Message> </Error>
ããã¾ã§ã§ãCloudFrontå´ã®è¨å®ã¯å®äºã§ãã
ç½²åä»ãURLã®ä½æ
次ã«ãç½²åä»ãURLãä½æãã¾ãã
AWS CLIã使ãæ¹æ³ãããããã§ããããã¾ããããªãã£ãã®ã§ãPerl ã使ã£ã¦URLç½²åãä½æãããã¨ã«ãã¾ããã
PHPãC#ãJavaçã使ãå ´åã§ãAWSããã¥ã¡ã³ãã«ã¯ãµã³ãã«ã³ã¼ããããã¾ãã
Perlã®ãµã³ãã«ã³ã¼ãã¯ãAWSããã¥ã¡ã³ã ç½²åä»ã URL ãä½æãã Perl ã¹ã¯ãªããã®ã½ã¼ã¹ã«æ²è¼ããã¦ãã¾ãã
æ¸å¼ã¯ä»¥ä¸ã®ãããªæãã§ãã
--url: CloudFrontã®è©²å½ãã¡ã¤ã«ã¸ã®URL
--private-key: ä¸è¨æé ã®ç§å¯éµãã¡ã¤ã«
--expires: URL ã«ãããã¡ã¤ã«ã¸ã®ã¢ã¯ã»ã¹ã®è¨±å¯ãåæ¢ããæ¥ä»ã¨æå»ãã¨ããã¯ã¿ã¤ã ã
--key-pair-id: CloudFrontã§ãããªãã¯ãã¼ãç»é²ããéã®ID
(ãªããä¸è¨é
ç®ã¯å¿
é ã§ããæåã--expires ãä»ããã«ãã£ããURLã¯çæã§ããã®ã§ãããMust include policy filename with --policy argument or an expirestime using --expiresãã¨æãããå®éã«ã¢ã¯ã»ã¹ãä¸å¯ã§ããã)
$ perl ./create_signurl_perl.pl --action encode --url https://xxxxxxx.cloudfront.net/index.html --private-key ./aws_private_key.pem --expires 2524575600 --key-pair-id K2XXXXXXXXX
ãã ãèªåã®WSLã®ç°å¢ã§Perlã¹ã¯ãªãããå®è¡ããã¨ããã¤ãã¨ã©ã¼ãã§ãã®ã§ããã®å 容ã¨å¯¾å¿ãã¡ã¢ãã¦ããã¾ãã
ã¨ã©ã¼ï¼libfile-slurp-perl ããã±ã¼ã¸ãç¡ãã¨ã®ãã¨ã
Can't locate File/Slurp.pm in @INC (you may need to install the File::Slurp module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at ./create_signurl_perl.pl line 95. BEGIN failed--compilation aborted at ./create_signurl_perl.pl line 95.
対å¿ï¼ãªãã¸ããªãæ´æ°ããä¸è¶³ãã¦ããããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ sudo apt update $ sudo apt install libfile-slurp-perl
ã¨ã©ã¼:URIããã±ã¼ã¸ãå ¥ã£ã¦ãªãã¨ã®ãã¨ã
Can't locate URI.pm in @INC (you may need to install the URI module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at ./create_signurl_perl.pl line 100. BEGIN failed--compilation aborted at ./create_signurl_perl.pl line 100.
対å¿ï¼åå¥ã§URIããã±ã¼ã¸ãå ¥ãã¦ãããã£ããã§ãããããã±ã¼ã¸ããã¸ã£ã¼ã§ãã cpanm ããã£ãã»ãããããã ã£ãã®ã§ãcpanm ãå ¥ãã¦ãããcpanmä¸ã§URIãã¤ã³ã¹ãã¼ã«ãããã¨ã«ã
$ sudo apt install cpanminus $ cpanm URI
ããã§ãcreate_signurl_perl.pl ãèµ°ãããURLã§ã¢ã¯ã»ã¹ããã¨HTMLã表示ããã¾ããã
ããããããã§æ³¨æç¹ãããã
htmlãã¡ã¤ã«ã«è¨è¼ãã¦ãåãCloudFrontä¸ã®åãªã½ã¼ã¹ã¯èªã¿è¾¼ã¾ãã¾ããã
ãªã®ã§ãHTMLãã¡ã¤ã«ããåç
§ããå
¨ã¦ã®ãªã½ã¼ã¹ã«ã¤ãã¦ããç½²åä»ãURLãçºè¡ãã¦ãªã³ã¯ãæ¸ãæããå¿
è¦ãããã¾ãã
以ä¸ã®ãããªæãã§ãã
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="robots" content="none"> <link rel="stylesheet" type="text/css" href="https://xxxx.cloudfront.net/style.css?Expires=2524575600&Signature=xxxxxxxxxxx_&Key-Pair-Id=xxxxxxx"> âãç½²åä»ãURLã«ããå¿ è¦ãããã <title>ãã¹ããµã¤ã</title> </head> <body> <p>hello world</p> <img src="pic.jpg" alt="" /> </body> </html>
ãã¾ããããã§ã¯ãªãã§ãããã ãã£ã¨ããæ¹æ³ãããã®ããããã¾ããããä»åã¯ã¨ããããããã§ã