SlideShare a Scribd company logo
CentOS 7 ධ㛛 
᪂䛧䛟⏕䜎䜜ኚ䜟䛳䛯CentOS
⮬ᕫ⤂௓ 
኱ཎ ៅ୍㑻䚷https://twitter.com/ohhara_shiojiri 
䠄᭷䠅䝖䝷䝇䝖䝛䝑䝖䝽䞊䜽䝇䚷ሷᑼ䜲䞁䜻䝳䝧䞊䝅䝵䞁䝥䝷䝄䠍䠌䠔ྕᐊ 
http://shiojiri-osslabo.com/ 
䞉㛗㔝┴ሷᑼᕷ䛻άືᣐⅬ䜢⨨䛟䚸ᕷෆ䝥䝻䜾䝷䝬䞊᭷ᚿ䛻䜘䜛ᅋయ 
䞉䛂䜸䞊䝥䞁䛺⎔ቃ䛷䜸䞊䝥䞁䛺άື䜢┠ᣦ䛩䛃䜢ྜゝⴥ䛻㞟䛖 
䞉CoderDojo Shiojiri 㛤ദ䚷䞉ᑠᏛ⏕㧗Ꮫᖺྥ䛡Rubyᩍᐊ㛤ദ 
䞉ITᢏ⾡᭩䜢䝸䝤䝷䜲䝈䛷㈚䛧ฟ䛧䚸䜎䛯ᕷ❧ᅗ᭩㤋䛸༠ຊ
䜰䝆䜵䞁䝎 
● CentOS䛻䛴䛔䛶 
● RHEL 7 䛻䛴䛔䛶 
● LAMP⎔ቃ䛻䛴䛔䛶 
● 䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 
● ᳨ド⎔ቃ 
● systemd 
● NetworkManager 
● iproute2
CentOS䛻䛴䛔䛶 
● Red Hat Enterprise Linux(RHEL)䜽䝻䞊䞁 
௚䛻Ꮫ⾡ྥ䛡䛻Scientific Linux 
● RHEL䛛䜙ၟᶆ䜔ၟ⏝䛾䝟䝑䜿䞊䝆䜢㝖እ 
● Community ENTerprise Operating System 
● Red Hat♫䛾᭷ൾ䝃䝫䞊䝖䜢ᚲせ䛸䛧䛺䛔⏝㏵ 
● 2014ᖺ1᭶Red Hat♫䛜ᨭ᥼⾲᫂ 
● RHEL䛸㧗䛔஫᥮ᛶ
RHEL 7 䛻䛴䛔䛶 
● 2014ᖺ6᭶10᪥䝸䝸䞊䝇 
● 10ᖺ㛫䝃䝫䞊䝖䚷2024ᖺ6᭶30᪥䜎䛷 
● Fedora19䜢䝧䞊䝇 
● 䜹䞊䝛䝹䝞䞊䝆䝵䞁 3.10 
● 64bit䛾䜏 x86_64/ppc64/s390s䝃䝫䞊䝖 
● ext4 → xfs䚷᭱኱500TB䝃䝫䞊䝖 
● GRUB Legacy → GRUB2䚷UEFI䝃䝫䞊䝖
LAMP⎔ቃ䛻䛴䛔䛶 
● LAMP⎔ቃ䛸䛧䛶䛾CentOS 
○ ᚑ᮶䝅䝇䝔䝮䛸䛾஫᥮ᛶ䛸Ᏻᐃᛶ䜢㔜ど䛧䛶䚸ᶆ‽䝟䝑 
䜿䞊䝆䛾䝞䞊䝆䝵䞁䛿ྂ䛔䜎䜎䛷䛧䛯䚹 
○ ྂ䛔䝞䞊䝆䝵䞁䛾䝃䝫䞊䝖䛜⥆䚻䛸⤊஢䛧䛶䛔䜛䚹 
○ ᛶ⬟ྥୖ䚸ᶵ⬟ྥୖ䚸䝉䜻䝳䝸䝔䜱ྥୖ䛜ồ䜑䜙䜜䜛䚹 
○ RHEL7(CentOS7)䛛䜙᪂䛧䛔䝞䞊䝆䝵䞁䜢᥇⏝䟿 
● CentOS6.5䛾LAMP⎔ቃ 
○ Apache䚷→䚷2.2.15䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ 
○ MySQL䚷→䚷5.1.73䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ 
○ PHP䚷→䚷5.3.3䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ 
○ Perl䚷→䚷5.10.1 
○ Python䚷→䚷2.6.6
LAMP⎔ቃ䛻䛴䛔䛶 
● CentOS7䛾LAMP⎔ቃ 
○ Apache䚷→䚷2.4.6䚷᭱᪂ᶵ⬟䛾Ᏻᐃ∧ 
○ MySQL䚷→䚷MySQL5.5஫᥮䛾MariaDB 5.5.37 
○ PHP䚷→䚷5.4.16䚷᭱᪂䛾PHP䛿5.6.0 
○ Perl䚷→䚷5.16.3䚷᭱᪂䛾Perl䛿5.20.0 
○ Python䚷→䚷2.7.5䚷᭱᪂䛾Python䛿3.4.1 
○ ྛ䝞䞊䝆䝵䞁䛿2014ᖺ9᭶10᪥᫬Ⅼ䛷䛩䚹 
● CentOS6.5䛷LAMP⎔ቃ䛾᪂䝞䞊䝆䝵䞁ᵓ⠏ 
䛿኱ኚ㠃ಽ䛺䛾䛷䚸CentOS7䜢฼⏝䛧䜎䛧䜗 
䛖䚹 
● CentOS6.5䛛䜙CentOS7䜈䛾⛣⾜䛜බᘧ䝃 
䝫䞊䝖䛥䜜䛶䛔䜎䛩䚹
䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 
● ᚑ᮶㏻䜚ISO䝣䜯䜲䝹䛜⏝ព䛥䜜䛶䛔䜎䛩䚹 
○ http://www.centos.org/download/ 
○ ᶆ‽䛷3.9GB䚷᭱኱䛾Everything䛷6.6GB䟿 
○ ᭱ᑠ䛾minimal䛷566MB 
○ 㧗㏿䝛䝑䝖⎔ቃ䛜䛒䜜䜀䚸Netinstall䛷362MB 
● 䜲䞁䝇䝖䞊䝷䞊䛾anaconda 
○ ᚑ᮶䛿䜲䞁䝇䝖䞊䝹䛾㡰䜢㏣䛳䛶䜸䝥䝅䝵䞁䜢タᐃ䛧䛶䛔 
䛯䛜䚸ண䜑䜸䝥䝅䝵䞁䜢㑅ᢥ䛧䛶䛛䜙䜲䞁䝇䝖䞊䝹ᐇ⾜䛜 
ฟ᮶䜛䜘䛖䛻䛺䛳䛯䚹
䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 
● 䜽䝷䜴䝗⎔ቃ⏝䛾䜲䝯䞊䝆䜢ணᐃ䛧䛶䛔䜎䛩䚹 
○ AWS➼䛾䝟䝤䝸䝑䜽䜽䝷䜴䝗 
○ OpenStack➼䛾䝥䝷䜲䝧䞊䝖䜽䝷䜴䝗 
○ Docker 
● 䜽䝷䜴䝗฼⏝⪅䜢᝿ᐃ䛧䛶䚸Vagrant䛾BOX䝣䜯 
䜲䝹䛻䛶௒ᅇ䛿Ꮫ⩦䛧䛶⾜䛝䜎䛩䚹
᳨ド⎔ቃ 
● VirtualBox 4.3.16(2014/09/11᫬Ⅼ) 
○ https://www.virtualbox.org/wiki/Downloads 
○ CPU䛾௬᝿䝬䝅䞁ᨭ᥼ᶵ⬟䛜ᚲせ(BIOSタᐃ) 
○ Windows䛾ሙྜ䚸䝅䝇䝔䝮䛾PATHタᐃ䛜ᚲせ 
■ 4.2⣔䚷C:Program FilesOracle VM VirtualBox 
■ 4.3⣔䚷C:Program FilesOracleVirtualBox
᳨ド⎔ቃ 
● Vagrant 1.6.5(2014/09/05᫬Ⅼ) 
○ http://www.vagrantup.com/downloads.html 
○ Windows䛾ሙྜ䚸䝅䝇䝔䝮䛾PATHタᐃ䛜ᚲせ 
■ C:HashiCorpVagrantbin 
■ C:HashiCorpVagrantembeddedmingwbin 
○ 䝁䝬䞁䝗䝥䝻䞁䝥䝖䛾௦䜟䜚䛻mingw32䛜౑⏝䛷䛝䜛䚹 
■ C:HashiCorpVagrantembeddedmingwmingw32env.cmd 
● BOX䝣䜯䜲䝹 CentOS 7 
○ https://dl.dropboxusercontent.com/s/w3lbekm7eunrskm/centos-7.0-x86_64.box 
○ CentOS7.0 x86_64 minimal + Puppet + VirtualBoxGuestAddtions 4.3.14
᳨ド⎔ቃ 
● Vagrantfile䜢⦅㞟䛧䛶IP䜰䝗䝺䝇䜢๭䜚ᙜ䛶䛯 
䝜䞊䝗䛷㉳ື䛥䛫䜎䛩䚹 
● Vagrantධ㛛䛾㈨ᩱ䜢ཧ↷䛧䛶ୗ䛥䛔䚹 
○ http://www.slideshare.net/ShinichiroOhhara/solavagrantver2
᳨ド⎔ቃ 
Virtual Box ⎔ቃ 
䜽䝷䜲䜰䞁䝖ഃ 
Ubuntu 14.04 
䝩䝇䝖PC 
䝹䞊䝍䞊 
192.168.33.1 
䝃䞊䝞䞊ഃ 
CentOS7 
192.168.33.70
systemd 
● 䝃䞊䝡䝇⟶⌮䛜systemd䜈ኚ᭦䛻䛺䜚䜎䛧䛯䚹 
○ 䝅䝇䝔䝮䛾㉳ື᫬䚸䝅䝱䝑䝖䝎䜴䞁᫬䛺䛹䚸䝃䞊䝡䝇䝥䝻 
䝉䝇䛾⟶⌮䝅䝇䝔䝮䛜᪂䛧䛟䛺䜚䜎䛧䛯䚹 
● ᚑ᮶䛿UNIX⏤᮶䛾init䛻䛶⟶⌮ 
○ UNIX䛾init䛻䛿䚸SystemV⣔䛸BSD⣔䛜䛒䜛 
○ RHEL5(CentOS5)䜎䛷䛿SysVinit 
○ /etc/inittab䛻タᐃ䛥䜜䛯䝷䞁䝺䝧䝹䛷⟶⌮ 
○ RHEL6(CentOS6)䛛䜙ubuntu䛸ྠ䛨Upstart 
○ /etc/init/௨ୗ䛾タᐃ䝣䜯䜲䝹䛷⟶⌮ 
○ Upstart䛿SysVinit஫᥮ 
○ ஫᥮ᛶ䛾䛒䜛䝅䜵䝹䝇䜽䝸䝥䝖䛷ືస䜢タᐃ
systemd 
● init䜘䜚ኚ䜟䛳䛯䛣䛸 
○ Upstart䜘䜚୪ิᗘ䛾㧗䛔㧗㏿䛺㉳ື䛸⤊஢ 
○ 䝅䜵䝹䝇䜽䝸䝥䝖䛷䛿䛺䛟タᐃ䝣䜯䜲䝹䛻䜘䜛⟶⌮ 
○ 䝃䞊䝡䝇䝥䝻䝉䝇㉳ື䛜ᵝ䚻䛺᪉ἲ䛷ᰂ㌾䛻ฟ᮶䜛 
○ cgroups䛻䜘䜛䝃䞊䝡䝇䝥䝻䝉䝇䛾䝸䝋䞊䝇⟶⌮ 
● Unit 
○ 䝃䞊䝡䝇䝥䝻䝉䝇䛾タᐃ䝣䜯䜲䝹 
○ systemd䛜Unit䛾タᐃ䛷ฎ⌮䛩䜛䚹 
○ ௚䛾Unit䛸㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅䛧䛶ฎ⌮䛜ฟ᮶䜛䚹 
○ ᣑᙇᏊ䛻䜘䛳䛶ᵝ䚻䛺Unit䛾✀㢮䛜䛒䜛䚹 
○ タ⨨ሙᡤ䛿䚸/etc/systemd/system 
○ 䜲䞁䝇䝖䞊䝹ึᮇタᐃ䛿䚸/usr/lib/systemd/system
systemd 
● 䝁䝬䞁䝗 
○ systemctl 䜸䝥䝅䝵䞁 Unitྡ 
○ ᚑ᮶䛸ྠ䛨service䜒౑⏝䛷䛝䜎䛩䚹 
● 䝃䞊䝡䝇䝥䝻䝉䝇䛾㉳ື䛸೵Ṇ 
○ Unit䛾ᣑᙇᏊ䛿䚸䛂.service䛃 
○ sytemctl [start/stop/restart] Unitྡ 
○ reload䜸䝥䝅䝵䞁䛿Unit䛻ᐃ⩏䛥䜜䛶䛔䜛ሙྜ䛾䜏 
● Unitタᐃ䛾ኚ᭦ 
○ Unitタᐃ䜢ኚ᭦䛧䛯᫬䛿䚸systemd䜈཯ᫎ䛥䛫䜎䛩䚹 
○ systemctl daemon-reload 
● 䝥䝻䝉䝇䛾≧ែ☜ㄆ 
○ systemctl status Unitྡ
systemd 
● ⮬ື㉳ື䛾タᐃ 
○ systemctl [enable/disable] Unitྡ 
○ Unit䛾㐃ᦠ䠄౫Ꮡ䠅タᐃ䛜ኚ᭦䛥䜜䜎䛩䚹 
○ Unitタᐃ䝣䜯䜲䝹䛷ᣦᐃ䛧䛯䛂WantedBy=䛃䝕䜱䝺䜽䝖䝸 
䜈䛾䝅䞁䝪䝸䝑䜽䝸䞁䜽 
● Wants 
○ 㐃ᦠ䠄౫Ꮡ䠅䛩䜛Unit䜢タᐃ䛧䜎䛩䚹 
○ Unitタᐃ䝣䜯䜲䝹䛾䛂Wants=䛃 
○ 䝕䜱䝺䜽䝖䝸䛂Unitྡ.wants䛃䜈䝅䞁䝪䝸䝑䜽䝸䞁䜽䜢సᡂ 
● Requires 
○ Wants䛿Unit㛫䛾ྠ᫬㉳ື䛜ኻᩋ䛧䛶䜒෌ᐇ⾜䛧䜎䛩䚹 
○ Requires䛿Unit㛫䛾ྠ᫬㉳ື䛜ኻᩋ䛧䛯䜙⤊஢䛧䜎 
䛩䚹
systemd 
● ⮬ື㉳ື䛾☜ㄆ 
○ systemctl list-unit-files --type=service 
○ enabled䚷→䚷䛂Wants=䛃グ㍕䛒䜚䚸᭷ຠ 
○ disabled䚷→䚷䛂Wants=䛃グ㍕䛒䜚䚸↓ຠ 
○ static䚷→䚷䛂Wants=䛃グ㍕↓䛧 
● ⌧ᅾ䛾Unit≧ែ䛾☜ㄆ 
○ systemctl list-units --type=service 
○ list-units䜸䝥䝅䝵䞁䜢┬␎ฟ᮶䜛䚹 
● Unit䛾㐃ᦠ㛵ಀ䛾☜ㄆ 
○ systemctl list-dependencies 
○ 䝒䝸䞊⾲♧䛷㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅㛵ಀ䜢⾲♧䛩䜛䚹
systemd 
● target 
○ 」ᩘ䛾Unit䜢䜎䛸䜑䛶䚸䜾䝹䞊䝥໬䛷䛝䜛䚹 
○ Unit䛾ᣑᙇᏊ䛿䚸䛂.target䛃 
○ 㛵ಀ䛩䜛」ᩘ䛾Unit䛾㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅䜢⟶⌮䚹 
○ target⮬య䛿ᐇ⾜䛧䛺䛔䚹 
○ ᚑ᮶䛾䝷䞁䝺䝧䝹䛜↓䛟䛺䜚䚸Unit䛾target䛻ኚ䜟䜚䜎䛧 
䛯䚹 
○ ᚑ᮶䛾䝷䞁䝺䝧䝹0䛛䜙6䛸㐪䛔䚸⮬⏤䛻タᐃฟ᮶䜛䚹 
● 䝅䝇䝔䝮䛾㉳ື≧ែ䛾ኚ᭦᪉ἲ 
○ /etc/systemd/system/default.target 
○ 䝅䞁䝪䝸䝑䜽䝸䞁䜽ඛ䜢ኚ᭦䛩䜛䛣䛸䛷䚸䝷䞁䝺䝧䝹┦ᙜ 
䜢ᐇ⌧䛧䛶䛔䜎䛩䚹
systemd 
● ᚑ᮶䛾䝷䞁䝺䝧䝹䛸䛾ᑐẚ 
○ runlevel0䛛䜙runlevel6䛾䝅䞁䝪䝸䝑䜽䝸䞁䜽䜒䛒䜛䚹 
ᚑ᮶䛾䝷䞁䝺䝧䝹 target䝣䜯䜲䝹ྡ ≧ែෆᐜ 
runlevel 䠌 poweroff.target ೵Ṇ 
runlevel 1 rescue.target 䝅䞁䜾䝹䝴䞊䝄䞊䝰䞊䝗 
runlevel 2 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 
runlevel 3 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 
runlevel 4 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 
runlevel 5 graphical.target GUI䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 
runlevel 6 reboot.target ෌㉳ື
systemd 
● 䛭䛾௚䛾Unit 
○ 䛂service䛃䛂target䛃䛾௚䛻䜒Unit䛾✀㢮䛜䛒䜚䜎䛩䚹 
● mount, swap 
○ /etc/fstab䛛䜙⮬ືసᡂ䛥䜜䜎䛩䚹 
● device 
○ 䝕䝞䜲䝇䛜ㄆ㆑䛩䜛䛸⮬ືసᡂ䛥䜜䜎䛩䚹 
● path 
○ 䝟䝇䜢┘ど䛧䛶䚸䝣䜯䜲䝹䛻ᛂ䛨䛶䝃䞊䝡䝇䜢㉳ື䚹 
● socket 
○ 䝋䜿䝑䝖䜢┘ど䛧䛶䚸᥋⥆䛻ᛂ䛨䛶䝃䞊䝡䝇䜢㉳ື䚹
NetworkManager 
● 䝛䝑䝖䝽䞊䜽䝕䝞䜲䝇タᐃ 
○ /etc/sysconfig/network-scipts/䛻䛒䜛タᐃ䝣䜯䜲䝹䜢┤ 
᥋⦅㞟䛩䜛䛾䛷䛿䛺䛟䚸NetworkManager䜢౑⏝䛩䜛䚹 
○ ᚑ᮶䛾タᐃ䝣䜯䜲䝹䜒฼⏝䛷䛝䜛䚹 
○ Ethernet䜲䞁䝍䞊䝣䜵䞊䝇䛿ᶆ‽䛷䛿↓ຠ䛻䛺䛳䛶䛔 
䜛䚹 
● NetworkManager䝣䝻䞁䝖䜶䞁䝗 
○ GUI䛾GNOME⎔ቃ䛷᧯స䛧䜎䛩䚹 
● nmtui 
○ 䝔䜻䝇䝖⏬㠃䛷ᑐヰⓗ䛻䝛䝑䝖䝽䞊䜽タᐃ䛧䜎䛩䚹
NetworkManager 
● nmcli 
○ 䝁䝬䞁䝗䝷䜲䞁䛷䝛䝑䝖䝽䞊䜽タᐃ䛧䜎䛩䚹 
○ 䝃䞊䝞䞊⟶⌮⪅ྥ䛡䛻䚸䛣䛣䛷䛿nmcli䜢Ꮫ⩦䛧䜎䛩䚹 
● 䝩䝇䝖ྡ䛾ኚ᭦ 
○ nmcli general hostname 䝩䝇䝖ྡ 
○ bmcli g ho 䝩䝇䝖ྡ 䛸┬␎䛷䛝䜛䚹 
○ /etc/hostname䝣䜯䜲䝹䛻タᐃ䛥䜜䜛䚹
NetworkManager 
● nmcli device 
○ ≀⌮䝕䝞䜲䝇䛾⟶⌮ 
● 䝕䝞䜲䝇䛾୍ぴ 
○ nmcli device 
○ nmcli d 䛸┬␎ฟ᮶䜛䚹 
● 䝕䝞䜲䝇䛾ヲ⣽ 
○ nmcli device show 䝕䝞䜲䝇ྡ 
○ nmcli d s 䛸┬␎ฟ᮶䜛䚹
NetworkManager 
● nmcli connection 
○ ᥋⥆タᐃ䛾⟶⌮ 
● ᥋⥆≧ἣ䛾୍ぴ 
○ nmcli connection 
○ nmcli c 䛸┬␎䛷䛝䜛䚹 
○ nmcli --fields 㡯┠ connection 䛷᳨⣴⾲♧䜒ฟ᮶䜛䚹 
● ᥋⥆䛾ヲ⣽ 
○ nmcli connection show ྡ๓䜒䛧䛟䛿UUID 
○ nmcli c s ྡ๓䜒䛧䛟䛿UUID䚷䛸┬␎䛷䛝䜛䚹 
○ ྡ๓䛻䝇䝨䞊䝇䛜䛒䜛䛸䛝䛿䚸䛂”䛃䝎䝤䝹䜽䜷䞊䝔䞊䝅䝵 
䞁䛷ᅖ䜣䛷ᣦᐃ䛩䜛䚹 
○ nmcli c s “Wired connection 1”
NetworkManager 
● ᥋⥆䛾᭷ຠ໬ 
○ nmcli connection up ྡ๓䜒䛧䛟䛿UUID 
● ᥋⥆䛾↓ຠ໬ 
○ nmcli connection down ྡ๓䜒䛧䛟䛿UUID 
● ᥋⥆䛾ືస☜ㄆ 
○ nmcli c s ྡ๓䜒䛧䛟䛿UUID 䛷IP䜰䝗䝺䝇䜢☜ㄆ 
○ ping 䛷␯㏻䜢☜ㄆ 
○ nmcli c d ྡ๓䜒䛧䛟䛿UUID 䛷↓ຠ໬ 
○ ping 䛷␯㏻ฟ᮶䛺䛔䛾䜢☜ㄆ 
○ nmcli c u ྡ๓䜒䛧䛟䛿UUID 䛷᭷ຠ໬ 
○ ping 䛷␯㏻䜢☜ㄆ
NetworkManager 
● タᐃ䛾ኚ᭦ 
○ nmcli connection modify ྡ๓ 㡯┠ タᐃ್ 
○ nmcli c m 䛸┬␎䛷䛝䜛䚹 
● IP䜰䝗䝺䝇䛸䝀䞊䝖䜴䜵䜲䛾ኚ᭦ 
○ DHCP䜢ᡭືタᐃ䜈ኚ᭦䛧䜎䛩䚹 
○ nmcli c m ྡ๓ ipv4.method manual 
○ nmcli c m ྡ๓ ipv4.addresses "IP䜰䝗䝺䝇/䝛䝑䝖䝬䝇 
䜽 䝀䞊䝖䜴䜵䜲" 
○ タᐃኚ᭦䛧䛯䛰䛡䛷䛿䚸タᐃ್䛿᭷ຠ䛻䛺䜙䛺䛔䚹 
○ ᥋⥆䜢down/up䛧䛯ᚋ䛷タᐃ್䛜᭷ຠ䛻䛺䜛䚹
NetworkManager 
● DNS䛾ኚ᭦ 
○ nmcli c m ྡ๓ ipv4.dns "DNS䝃䞊䝞䞊䛾IP䜰䝗䝺䝇" 
● タᐃ್䛾㏣ຍ䛸๐㝖 
○ ᪤Ꮡ䛾್䛻㏣ຍ䛩䜛ሙྜ䛿䚸㡯┠ྡ䛾๓䛻䛂䠇䛃䜢௜䛡 
䜛䚹 
○ ᪤Ꮡ䛾್䛛䜙๐㝖䛩䜛ሙྜ䛿䚸㡯┠ྡ䛾๓䛻䛂䞊䛃䜢௜ 
䛡䜛䚹 
○ nmcli c m ྡ๓ +㡯┠ྡ ್ 
○ nmcli c m ྡ๓ -㡯┠ྡ ್ 
● DHCP䛾タᐃ 
○ nmcli c m ྡ๓ ipv4.method auto
iproute2 
● 䝛䝑䝖䝽䞊䜽タᐃ䝁䝬䞁䝗䛾ኚ᭦ 
○ 䝕䝞䜲䝇ྡ䛜䛂eth␒ྕ䛃䛛䜙䛂enྡ⛠䛃䜈ኚ᭦䛻䛺䜚䜎䛧 
䛯䚹 
○ ᚑ᮶䛾ifconfig,route,arp,netstat䝁䝬䞁䝗䛿㠀᥎ዡ䚹 
○ ᶆ‽䛷䛿౑⏝䛷䛝䜎䛫䜣䚹 
○ ู㏵䚸net-tools䝟䝑䜿䞊䝆䜢䜲䞁䝇䝖䞊䝹䛩䜜䜀౑⏝ฟ 
᮶䜎䛩䚹 
○ yum install net-tools 
○ ᪂䛧䛔iproute2䝟䝑䜿䞊䝆䛾䝁䝬䞁䝗䜢᥎ዡ䛧䜎䛩䚹 
○ ྂ䛔䝁䝬䞁䝗䛿ᛀ䜜䛶᪂䛧䛔䝁䝬䞁䝗䜢Ꮫ⩦䛧䜎䛧䜗䛖䚹
iproute2 
● ip addr show 
○ ipconfig䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 
○ 䝕䝞䜲䝇䛾䜰䝗䝺䝇䜢⾲♧䛩䜛䚹 
○ ฎ⌮䝟䜿䝑䝖䛾⤫ィ䛿⾲♧䛥䜜䛺䛔䚹 
● ip -s link 
○ ipconfig䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 
○ ᥋⥆䛾ฎ⌮䝟䜿䝑䝖䛾⤫ィ䜢⾲♧䛩䜛䚹 
● ip route 
○ route䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 
○ 䝹䞊䝔䜱䞁䜾䝔䞊䝤䝹䜢⾲♧䛩䜛䚹
iproute2 
● ip neigh 
○ arp䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 
○ 䝕䝞䜲䝇䛾Mac䜰䝗䝺䝇䜢⾲♧䛩䜛䚹 
● ip䝁䝬䞁䝗 
○ ྛ䝛䝑䝖䝽䞊䜽タᐃ䜢ኚ᭦䛩䜛䛣䛸䛜ฟ᮶䜎䛩䚹 
○ 䝕䝞䜲䝇䜢down/up䛩䜛஦↓䛟䚸タᐃ䛿༶཯ᫎ䛧䜎䛩䚹 
○ タᐃ್䛿ಖᏑ䛥䜜䜎䛫䜣䚹 
● ss 
○ netstat䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 
○ 䝃䞊䝡䝇䛾౑⏝≧ἣ䜢⾲♧䛩䜛䚹

More Related Content

CentOS 7 入門

  • 1. CentOS 7 ධ㛛 ᪂䛧䛟⏕䜎䜜ኚ䜟䛳䛯CentOS
  • 2. ⮬ᕫ⤂௓ ኱ཎ ៅ୍㑻䚷https://twitter.com/ohhara_shiojiri 䠄᭷䠅䝖䝷䝇䝖䝛䝑䝖䝽䞊䜽䝇䚷ሷᑼ䜲䞁䜻䝳䝧䞊䝅䝵䞁䝥䝷䝄䠍䠌䠔ྕᐊ http://shiojiri-osslabo.com/ 䞉㛗㔝┴ሷᑼᕷ䛻άືᣐⅬ䜢⨨䛟䚸ᕷෆ䝥䝻䜾䝷䝬䞊᭷ᚿ䛻䜘䜛ᅋయ 䞉䛂䜸䞊䝥䞁䛺⎔ቃ䛷䜸䞊䝥䞁䛺άື䜢┠ᣦ䛩䛃䜢ྜゝⴥ䛻㞟䛖 䞉CoderDojo Shiojiri 㛤ദ䚷䞉ᑠᏛ⏕㧗Ꮫᖺྥ䛡Rubyᩍᐊ㛤ദ 䞉ITᢏ⾡᭩䜢䝸䝤䝷䜲䝈䛷㈚䛧ฟ䛧䚸䜎䛯ᕷ❧ᅗ᭩㤋䛸༠ຊ
  • 3. 䜰䝆䜵䞁䝎 ● CentOS䛻䛴䛔䛶 ● RHEL 7 䛻䛴䛔䛶 ● LAMP⎔ቃ䛻䛴䛔䛶 ● 䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 ● ᳨ド⎔ቃ ● systemd ● NetworkManager ● iproute2
  • 4. CentOS䛻䛴䛔䛶 ● Red Hat Enterprise Linux(RHEL)䜽䝻䞊䞁 ௚䛻Ꮫ⾡ྥ䛡䛻Scientific Linux ● RHEL䛛䜙ၟᶆ䜔ၟ⏝䛾䝟䝑䜿䞊䝆䜢㝖እ ● Community ENTerprise Operating System ● Red Hat♫䛾᭷ൾ䝃䝫䞊䝖䜢ᚲせ䛸䛧䛺䛔⏝㏵ ● 2014ᖺ1᭶Red Hat♫䛜ᨭ᥼⾲᫂ ● RHEL䛸㧗䛔஫᥮ᛶ
  • 5. RHEL 7 䛻䛴䛔䛶 ● 2014ᖺ6᭶10᪥䝸䝸䞊䝇 ● 10ᖺ㛫䝃䝫䞊䝖䚷2024ᖺ6᭶30᪥䜎䛷 ● Fedora19䜢䝧䞊䝇 ● 䜹䞊䝛䝹䝞䞊䝆䝵䞁 3.10 ● 64bit䛾䜏 x86_64/ppc64/s390s䝃䝫䞊䝖 ● ext4 → xfs䚷᭱኱500TB䝃䝫䞊䝖 ● GRUB Legacy → GRUB2䚷UEFI䝃䝫䞊䝖
  • 6. LAMP⎔ቃ䛻䛴䛔䛶 ● LAMP⎔ቃ䛸䛧䛶䛾CentOS ○ ᚑ᮶䝅䝇䝔䝮䛸䛾஫᥮ᛶ䛸Ᏻᐃᛶ䜢㔜ど䛧䛶䚸ᶆ‽䝟䝑 䜿䞊䝆䛾䝞䞊䝆䝵䞁䛿ྂ䛔䜎䜎䛷䛧䛯䚹 ○ ྂ䛔䝞䞊䝆䝵䞁䛾䝃䝫䞊䝖䛜⥆䚻䛸⤊஢䛧䛶䛔䜛䚹 ○ ᛶ⬟ྥୖ䚸ᶵ⬟ྥୖ䚸䝉䜻䝳䝸䝔䜱ྥୖ䛜ồ䜑䜙䜜䜛䚹 ○ RHEL7(CentOS7)䛛䜙᪂䛧䛔䝞䞊䝆䝵䞁䜢᥇⏝䟿 ● CentOS6.5䛾LAMP⎔ቃ ○ Apache䚷→䚷2.2.15䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ ○ MySQL䚷→䚷5.1.73䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ ○ PHP䚷→䚷5.3.3䚷㛤Ⓨ⤊஢䚷᪂∧⛣⾜䜢᥎ዡ ○ Perl䚷→䚷5.10.1 ○ Python䚷→䚷2.6.6
  • 7. LAMP⎔ቃ䛻䛴䛔䛶 ● CentOS7䛾LAMP⎔ቃ ○ Apache䚷→䚷2.4.6䚷᭱᪂ᶵ⬟䛾Ᏻᐃ∧ ○ MySQL䚷→䚷MySQL5.5஫᥮䛾MariaDB 5.5.37 ○ PHP䚷→䚷5.4.16䚷᭱᪂䛾PHP䛿5.6.0 ○ Perl䚷→䚷5.16.3䚷᭱᪂䛾Perl䛿5.20.0 ○ Python䚷→䚷2.7.5䚷᭱᪂䛾Python䛿3.4.1 ○ ྛ䝞䞊䝆䝵䞁䛿2014ᖺ9᭶10᪥᫬Ⅼ䛷䛩䚹 ● CentOS6.5䛷LAMP⎔ቃ䛾᪂䝞䞊䝆䝵䞁ᵓ⠏ 䛿኱ኚ㠃ಽ䛺䛾䛷䚸CentOS7䜢฼⏝䛧䜎䛧䜗 䛖䚹 ● CentOS6.5䛛䜙CentOS7䜈䛾⛣⾜䛜බᘧ䝃 䝫䞊䝖䛥䜜䛶䛔䜎䛩䚹
  • 8. 䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 ● ᚑ᮶㏻䜚ISO䝣䜯䜲䝹䛜⏝ព䛥䜜䛶䛔䜎䛩䚹 ○ http://www.centos.org/download/ ○ ᶆ‽䛷3.9GB䚷᭱኱䛾Everything䛷6.6GB䟿 ○ ᭱ᑠ䛾minimal䛷566MB ○ 㧗㏿䝛䝑䝖⎔ቃ䛜䛒䜜䜀䚸Netinstall䛷362MB ● 䜲䞁䝇䝖䞊䝷䞊䛾anaconda ○ ᚑ᮶䛿䜲䞁䝇䝖䞊䝹䛾㡰䜢㏣䛳䛶䜸䝥䝅䝵䞁䜢タᐃ䛧䛶䛔 䛯䛜䚸ண䜑䜸䝥䝅䝵䞁䜢㑅ᢥ䛧䛶䛛䜙䜲䞁䝇䝖䞊䝹ᐇ⾜䛜 ฟ᮶䜛䜘䛖䛻䛺䛳䛯䚹
  • 9. 䜲䞁䝇䝖䞊䝹䛻䛴䛔䛶 ● 䜽䝷䜴䝗⎔ቃ⏝䛾䜲䝯䞊䝆䜢ணᐃ䛧䛶䛔䜎䛩䚹 ○ AWS➼䛾䝟䝤䝸䝑䜽䜽䝷䜴䝗 ○ OpenStack➼䛾䝥䝷䜲䝧䞊䝖䜽䝷䜴䝗 ○ Docker ● 䜽䝷䜴䝗฼⏝⪅䜢᝿ᐃ䛧䛶䚸Vagrant䛾BOX䝣䜯 䜲䝹䛻䛶௒ᅇ䛿Ꮫ⩦䛧䛶⾜䛝䜎䛩䚹
  • 10. ᳨ド⎔ቃ ● VirtualBox 4.3.16(2014/09/11᫬Ⅼ) ○ https://www.virtualbox.org/wiki/Downloads ○ CPU䛾௬᝿䝬䝅䞁ᨭ᥼ᶵ⬟䛜ᚲせ(BIOSタᐃ) ○ Windows䛾ሙྜ䚸䝅䝇䝔䝮䛾PATHタᐃ䛜ᚲせ ■ 4.2⣔䚷C:Program FilesOracle VM VirtualBox ■ 4.3⣔䚷C:Program FilesOracleVirtualBox
  • 11. ᳨ド⎔ቃ ● Vagrant 1.6.5(2014/09/05᫬Ⅼ) ○ http://www.vagrantup.com/downloads.html ○ Windows䛾ሙྜ䚸䝅䝇䝔䝮䛾PATHタᐃ䛜ᚲせ ■ C:HashiCorpVagrantbin ■ C:HashiCorpVagrantembeddedmingwbin ○ 䝁䝬䞁䝗䝥䝻䞁䝥䝖䛾௦䜟䜚䛻mingw32䛜౑⏝䛷䛝䜛䚹 ■ C:HashiCorpVagrantembeddedmingwmingw32env.cmd ● BOX䝣䜯䜲䝹 CentOS 7 ○ https://dl.dropboxusercontent.com/s/w3lbekm7eunrskm/centos-7.0-x86_64.box ○ CentOS7.0 x86_64 minimal + Puppet + VirtualBoxGuestAddtions 4.3.14
  • 12. ᳨ド⎔ቃ ● Vagrantfile䜢⦅㞟䛧䛶IP䜰䝗䝺䝇䜢๭䜚ᙜ䛶䛯 䝜䞊䝗䛷㉳ື䛥䛫䜎䛩䚹 ● Vagrantධ㛛䛾㈨ᩱ䜢ཧ↷䛧䛶ୗ䛥䛔䚹 ○ http://www.slideshare.net/ShinichiroOhhara/solavagrantver2
  • 13. ᳨ド⎔ቃ Virtual Box ⎔ቃ 䜽䝷䜲䜰䞁䝖ഃ Ubuntu 14.04 䝩䝇䝖PC 䝹䞊䝍䞊 192.168.33.1 䝃䞊䝞䞊ഃ CentOS7 192.168.33.70
  • 14. systemd ● 䝃䞊䝡䝇⟶⌮䛜systemd䜈ኚ᭦䛻䛺䜚䜎䛧䛯䚹 ○ 䝅䝇䝔䝮䛾㉳ື᫬䚸䝅䝱䝑䝖䝎䜴䞁᫬䛺䛹䚸䝃䞊䝡䝇䝥䝻 䝉䝇䛾⟶⌮䝅䝇䝔䝮䛜᪂䛧䛟䛺䜚䜎䛧䛯䚹 ● ᚑ᮶䛿UNIX⏤᮶䛾init䛻䛶⟶⌮ ○ UNIX䛾init䛻䛿䚸SystemV⣔䛸BSD⣔䛜䛒䜛 ○ RHEL5(CentOS5)䜎䛷䛿SysVinit ○ /etc/inittab䛻タᐃ䛥䜜䛯䝷䞁䝺䝧䝹䛷⟶⌮ ○ RHEL6(CentOS6)䛛䜙ubuntu䛸ྠ䛨Upstart ○ /etc/init/௨ୗ䛾タᐃ䝣䜯䜲䝹䛷⟶⌮ ○ Upstart䛿SysVinit஫᥮ ○ ஫᥮ᛶ䛾䛒䜛䝅䜵䝹䝇䜽䝸䝥䝖䛷ືస䜢タᐃ
  • 15. systemd ● init䜘䜚ኚ䜟䛳䛯䛣䛸 ○ Upstart䜘䜚୪ิᗘ䛾㧗䛔㧗㏿䛺㉳ື䛸⤊஢ ○ 䝅䜵䝹䝇䜽䝸䝥䝖䛷䛿䛺䛟タᐃ䝣䜯䜲䝹䛻䜘䜛⟶⌮ ○ 䝃䞊䝡䝇䝥䝻䝉䝇㉳ື䛜ᵝ䚻䛺᪉ἲ䛷ᰂ㌾䛻ฟ᮶䜛 ○ cgroups䛻䜘䜛䝃䞊䝡䝇䝥䝻䝉䝇䛾䝸䝋䞊䝇⟶⌮ ● Unit ○ 䝃䞊䝡䝇䝥䝻䝉䝇䛾タᐃ䝣䜯䜲䝹 ○ systemd䛜Unit䛾タᐃ䛷ฎ⌮䛩䜛䚹 ○ ௚䛾Unit䛸㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅䛧䛶ฎ⌮䛜ฟ᮶䜛䚹 ○ ᣑᙇᏊ䛻䜘䛳䛶ᵝ䚻䛺Unit䛾✀㢮䛜䛒䜛䚹 ○ タ⨨ሙᡤ䛿䚸/etc/systemd/system ○ 䜲䞁䝇䝖䞊䝹ึᮇタᐃ䛿䚸/usr/lib/systemd/system
  • 16. systemd ● 䝁䝬䞁䝗 ○ systemctl 䜸䝥䝅䝵䞁 Unitྡ ○ ᚑ᮶䛸ྠ䛨service䜒౑⏝䛷䛝䜎䛩䚹 ● 䝃䞊䝡䝇䝥䝻䝉䝇䛾㉳ື䛸೵Ṇ ○ Unit䛾ᣑᙇᏊ䛿䚸䛂.service䛃 ○ sytemctl [start/stop/restart] Unitྡ ○ reload䜸䝥䝅䝵䞁䛿Unit䛻ᐃ⩏䛥䜜䛶䛔䜛ሙྜ䛾䜏 ● Unitタᐃ䛾ኚ᭦ ○ Unitタᐃ䜢ኚ᭦䛧䛯᫬䛿䚸systemd䜈཯ᫎ䛥䛫䜎䛩䚹 ○ systemctl daemon-reload ● 䝥䝻䝉䝇䛾≧ែ☜ㄆ ○ systemctl status Unitྡ
  • 17. systemd ● ⮬ື㉳ື䛾タᐃ ○ systemctl [enable/disable] Unitྡ ○ Unit䛾㐃ᦠ䠄౫Ꮡ䠅タᐃ䛜ኚ᭦䛥䜜䜎䛩䚹 ○ Unitタᐃ䝣䜯䜲䝹䛷ᣦᐃ䛧䛯䛂WantedBy=䛃䝕䜱䝺䜽䝖䝸 䜈䛾䝅䞁䝪䝸䝑䜽䝸䞁䜽 ● Wants ○ 㐃ᦠ䠄౫Ꮡ䠅䛩䜛Unit䜢タᐃ䛧䜎䛩䚹 ○ Unitタᐃ䝣䜯䜲䝹䛾䛂Wants=䛃 ○ 䝕䜱䝺䜽䝖䝸䛂Unitྡ.wants䛃䜈䝅䞁䝪䝸䝑䜽䝸䞁䜽䜢సᡂ ● Requires ○ Wants䛿Unit㛫䛾ྠ᫬㉳ື䛜ኻᩋ䛧䛶䜒෌ᐇ⾜䛧䜎䛩䚹 ○ Requires䛿Unit㛫䛾ྠ᫬㉳ື䛜ኻᩋ䛧䛯䜙⤊஢䛧䜎 䛩䚹
  • 18. systemd ● ⮬ື㉳ື䛾☜ㄆ ○ systemctl list-unit-files --type=service ○ enabled䚷→䚷䛂Wants=䛃グ㍕䛒䜚䚸᭷ຠ ○ disabled䚷→䚷䛂Wants=䛃グ㍕䛒䜚䚸↓ຠ ○ static䚷→䚷䛂Wants=䛃グ㍕↓䛧 ● ⌧ᅾ䛾Unit≧ែ䛾☜ㄆ ○ systemctl list-units --type=service ○ list-units䜸䝥䝅䝵䞁䜢┬␎ฟ᮶䜛䚹 ● Unit䛾㐃ᦠ㛵ಀ䛾☜ㄆ ○ systemctl list-dependencies ○ 䝒䝸䞊⾲♧䛷㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅㛵ಀ䜢⾲♧䛩䜛䚹
  • 19. systemd ● target ○ 」ᩘ䛾Unit䜢䜎䛸䜑䛶䚸䜾䝹䞊䝥໬䛷䛝䜛䚹 ○ Unit䛾ᣑᙇᏊ䛿䚸䛂.target䛃 ○ 㛵ಀ䛩䜛」ᩘ䛾Unit䛾㐃ᦠ䠄౫Ꮡ䛸㉳ື㡰䠅䜢⟶⌮䚹 ○ target⮬య䛿ᐇ⾜䛧䛺䛔䚹 ○ ᚑ᮶䛾䝷䞁䝺䝧䝹䛜↓䛟䛺䜚䚸Unit䛾target䛻ኚ䜟䜚䜎䛧 䛯䚹 ○ ᚑ᮶䛾䝷䞁䝺䝧䝹0䛛䜙6䛸㐪䛔䚸⮬⏤䛻タᐃฟ᮶䜛䚹 ● 䝅䝇䝔䝮䛾㉳ື≧ែ䛾ኚ᭦᪉ἲ ○ /etc/systemd/system/default.target ○ 䝅䞁䝪䝸䝑䜽䝸䞁䜽ඛ䜢ኚ᭦䛩䜛䛣䛸䛷䚸䝷䞁䝺䝧䝹┦ᙜ 䜢ᐇ⌧䛧䛶䛔䜎䛩䚹
  • 20. systemd ● ᚑ᮶䛾䝷䞁䝺䝧䝹䛸䛾ᑐẚ ○ runlevel0䛛䜙runlevel6䛾䝅䞁䝪䝸䝑䜽䝸䞁䜽䜒䛒䜛䚹 ᚑ᮶䛾䝷䞁䝺䝧䝹 target䝣䜯䜲䝹ྡ ≧ែෆᐜ runlevel 䠌 poweroff.target ೵Ṇ runlevel 1 rescue.target 䝅䞁䜾䝹䝴䞊䝄䞊䝰䞊䝗 runlevel 2 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 runlevel 3 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 runlevel 4 multi-user.target 䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 runlevel 5 graphical.target GUI䝬䝹䝏䝴䞊䝄䞊䝰䞊䝗 runlevel 6 reboot.target ෌㉳ື
  • 21. systemd ● 䛭䛾௚䛾Unit ○ 䛂service䛃䛂target䛃䛾௚䛻䜒Unit䛾✀㢮䛜䛒䜚䜎䛩䚹 ● mount, swap ○ /etc/fstab䛛䜙⮬ືసᡂ䛥䜜䜎䛩䚹 ● device ○ 䝕䝞䜲䝇䛜ㄆ㆑䛩䜛䛸⮬ືసᡂ䛥䜜䜎䛩䚹 ● path ○ 䝟䝇䜢┘ど䛧䛶䚸䝣䜯䜲䝹䛻ᛂ䛨䛶䝃䞊䝡䝇䜢㉳ື䚹 ● socket ○ 䝋䜿䝑䝖䜢┘ど䛧䛶䚸᥋⥆䛻ᛂ䛨䛶䝃䞊䝡䝇䜢㉳ື䚹
  • 22. NetworkManager ● 䝛䝑䝖䝽䞊䜽䝕䝞䜲䝇タᐃ ○ /etc/sysconfig/network-scipts/䛻䛒䜛タᐃ䝣䜯䜲䝹䜢┤ ᥋⦅㞟䛩䜛䛾䛷䛿䛺䛟䚸NetworkManager䜢౑⏝䛩䜛䚹 ○ ᚑ᮶䛾タᐃ䝣䜯䜲䝹䜒฼⏝䛷䛝䜛䚹 ○ Ethernet䜲䞁䝍䞊䝣䜵䞊䝇䛿ᶆ‽䛷䛿↓ຠ䛻䛺䛳䛶䛔 䜛䚹 ● NetworkManager䝣䝻䞁䝖䜶䞁䝗 ○ GUI䛾GNOME⎔ቃ䛷᧯స䛧䜎䛩䚹 ● nmtui ○ 䝔䜻䝇䝖⏬㠃䛷ᑐヰⓗ䛻䝛䝑䝖䝽䞊䜽タᐃ䛧䜎䛩䚹
  • 23. NetworkManager ● nmcli ○ 䝁䝬䞁䝗䝷䜲䞁䛷䝛䝑䝖䝽䞊䜽タᐃ䛧䜎䛩䚹 ○ 䝃䞊䝞䞊⟶⌮⪅ྥ䛡䛻䚸䛣䛣䛷䛿nmcli䜢Ꮫ⩦䛧䜎䛩䚹 ● 䝩䝇䝖ྡ䛾ኚ᭦ ○ nmcli general hostname 䝩䝇䝖ྡ ○ bmcli g ho 䝩䝇䝖ྡ 䛸┬␎䛷䛝䜛䚹 ○ /etc/hostname䝣䜯䜲䝹䛻タᐃ䛥䜜䜛䚹
  • 24. NetworkManager ● nmcli device ○ ≀⌮䝕䝞䜲䝇䛾⟶⌮ ● 䝕䝞䜲䝇䛾୍ぴ ○ nmcli device ○ nmcli d 䛸┬␎ฟ᮶䜛䚹 ● 䝕䝞䜲䝇䛾ヲ⣽ ○ nmcli device show 䝕䝞䜲䝇ྡ ○ nmcli d s 䛸┬␎ฟ᮶䜛䚹
  • 25. NetworkManager ● nmcli connection ○ ᥋⥆タᐃ䛾⟶⌮ ● ᥋⥆≧ἣ䛾୍ぴ ○ nmcli connection ○ nmcli c 䛸┬␎䛷䛝䜛䚹 ○ nmcli --fields 㡯┠ connection 䛷᳨⣴⾲♧䜒ฟ᮶䜛䚹 ● ᥋⥆䛾ヲ⣽ ○ nmcli connection show ྡ๓䜒䛧䛟䛿UUID ○ nmcli c s ྡ๓䜒䛧䛟䛿UUID䚷䛸┬␎䛷䛝䜛䚹 ○ ྡ๓䛻䝇䝨䞊䝇䛜䛒䜛䛸䛝䛿䚸䛂”䛃䝎䝤䝹䜽䜷䞊䝔䞊䝅䝵 䞁䛷ᅖ䜣䛷ᣦᐃ䛩䜛䚹 ○ nmcli c s “Wired connection 1”
  • 26. NetworkManager ● ᥋⥆䛾᭷ຠ໬ ○ nmcli connection up ྡ๓䜒䛧䛟䛿UUID ● ᥋⥆䛾↓ຠ໬ ○ nmcli connection down ྡ๓䜒䛧䛟䛿UUID ● ᥋⥆䛾ືస☜ㄆ ○ nmcli c s ྡ๓䜒䛧䛟䛿UUID 䛷IP䜰䝗䝺䝇䜢☜ㄆ ○ ping 䛷␯㏻䜢☜ㄆ ○ nmcli c d ྡ๓䜒䛧䛟䛿UUID 䛷↓ຠ໬ ○ ping 䛷␯㏻ฟ᮶䛺䛔䛾䜢☜ㄆ ○ nmcli c u ྡ๓䜒䛧䛟䛿UUID 䛷᭷ຠ໬ ○ ping 䛷␯㏻䜢☜ㄆ
  • 27. NetworkManager ● タᐃ䛾ኚ᭦ ○ nmcli connection modify ྡ๓ 㡯┠ タᐃ್ ○ nmcli c m 䛸┬␎䛷䛝䜛䚹 ● IP䜰䝗䝺䝇䛸䝀䞊䝖䜴䜵䜲䛾ኚ᭦ ○ DHCP䜢ᡭືタᐃ䜈ኚ᭦䛧䜎䛩䚹 ○ nmcli c m ྡ๓ ipv4.method manual ○ nmcli c m ྡ๓ ipv4.addresses "IP䜰䝗䝺䝇/䝛䝑䝖䝬䝇 䜽 䝀䞊䝖䜴䜵䜲" ○ タᐃኚ᭦䛧䛯䛰䛡䛷䛿䚸タᐃ್䛿᭷ຠ䛻䛺䜙䛺䛔䚹 ○ ᥋⥆䜢down/up䛧䛯ᚋ䛷タᐃ್䛜᭷ຠ䛻䛺䜛䚹
  • 28. NetworkManager ● DNS䛾ኚ᭦ ○ nmcli c m ྡ๓ ipv4.dns "DNS䝃䞊䝞䞊䛾IP䜰䝗䝺䝇" ● タᐃ್䛾㏣ຍ䛸๐㝖 ○ ᪤Ꮡ䛾್䛻㏣ຍ䛩䜛ሙྜ䛿䚸㡯┠ྡ䛾๓䛻䛂䠇䛃䜢௜䛡 䜛䚹 ○ ᪤Ꮡ䛾್䛛䜙๐㝖䛩䜛ሙྜ䛿䚸㡯┠ྡ䛾๓䛻䛂䞊䛃䜢௜ 䛡䜛䚹 ○ nmcli c m ྡ๓ +㡯┠ྡ ್ ○ nmcli c m ྡ๓ -㡯┠ྡ ್ ● DHCP䛾タᐃ ○ nmcli c m ྡ๓ ipv4.method auto
  • 29. iproute2 ● 䝛䝑䝖䝽䞊䜽タᐃ䝁䝬䞁䝗䛾ኚ᭦ ○ 䝕䝞䜲䝇ྡ䛜䛂eth␒ྕ䛃䛛䜙䛂enྡ⛠䛃䜈ኚ᭦䛻䛺䜚䜎䛧 䛯䚹 ○ ᚑ᮶䛾ifconfig,route,arp,netstat䝁䝬䞁䝗䛿㠀᥎ዡ䚹 ○ ᶆ‽䛷䛿౑⏝䛷䛝䜎䛫䜣䚹 ○ ู㏵䚸net-tools䝟䝑䜿䞊䝆䜢䜲䞁䝇䝖䞊䝹䛩䜜䜀౑⏝ฟ ᮶䜎䛩䚹 ○ yum install net-tools ○ ᪂䛧䛔iproute2䝟䝑䜿䞊䝆䛾䝁䝬䞁䝗䜢᥎ዡ䛧䜎䛩䚹 ○ ྂ䛔䝁䝬䞁䝗䛿ᛀ䜜䛶᪂䛧䛔䝁䝬䞁䝗䜢Ꮫ⩦䛧䜎䛧䜗䛖䚹
  • 30. iproute2 ● ip addr show ○ ipconfig䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 ○ 䝕䝞䜲䝇䛾䜰䝗䝺䝇䜢⾲♧䛩䜛䚹 ○ ฎ⌮䝟䜿䝑䝖䛾⤫ィ䛿⾲♧䛥䜜䛺䛔䚹 ● ip -s link ○ ipconfig䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 ○ ᥋⥆䛾ฎ⌮䝟䜿䝑䝖䛾⤫ィ䜢⾲♧䛩䜛䚹 ● ip route ○ route䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 ○ 䝹䞊䝔䜱䞁䜾䝔䞊䝤䝹䜢⾲♧䛩䜛䚹
  • 31. iproute2 ● ip neigh ○ arp䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 ○ 䝕䝞䜲䝇䛾Mac䜰䝗䝺䝇䜢⾲♧䛩䜛䚹 ● ip䝁䝬䞁䝗 ○ ྛ䝛䝑䝖䝽䞊䜽タᐃ䜢ኚ᭦䛩䜛䛣䛸䛜ฟ᮶䜎䛩䚹 ○ 䝕䝞䜲䝇䜢down/up䛩䜛஦↓䛟䚸タᐃ䛿༶཯ᫎ䛧䜎䛩䚹 ○ タᐃ್䛿ಖᏑ䛥䜜䜎䛫䜣䚹 ● ss ○ netstat䛻┦ᙜ䛩䜛䝁䝬䞁䝗䚹 ○ 䝃䞊䝡䝇䛾౑⏝≧ἣ䜢⾲♧䛩䜛䚹