VirtualBoxã§CenOSã®ã¯ãã¼ã³ãä½æãã
VirtualBoxã§ä½æããä»®æ³ãã·ã³ããã¼ã¹ã«æ°ããä»®æ³ãã·ã³ãç¨æããæ¹æ³ã
è¤è£½å ã®ä»®æ³ãã·ã³
- CentOS 6.4 minimal 64bit
- NICã¯NATç¨ã¨ãã¹ããªã³ãªã¼ã¢ããã¿ã¼ç¨ã®2ã¤
Ubuntuçã¯ãVirtualBoxã§ã¯ãã¼ã³ãä½æãã - ä½æ¥ãã¼ããåç §ã
ã¯ãã¼ã³ä½æ
1. VirtualBoxããã¼ã¸ã£ã§ãè¤è£½å ã®ä»®æ³ãã·ã³ãé¸æ
ä»®æ³ãã·ã³ã¯é»æºãªãã®ç¶æ ã«ããã
2. å³ã¯ãªãã¯ããã¡ãã¥ã¼ãããã¯ãã¼ã³ããé¸æ
- ãæ°ãããã·ã³åãã¦ã£ã¶ã¼ã
- ä»®æ³ãã·ã³åãå ¥åãã
- ããã¹ã¦ã®ãããã¯ã¼ã¯ã«ã¼ãã®MACã¢ãã¬ã¹ãååæåãããªã³
- ãç¶ããããã¿ã³ãããã¦æ¬¡ã¸
- ãã¯ãã¼ã³ã®ã¿ã¤ããã¦ã£ã¶ã¼ã
- ããã¹ã¦ãã¯ãã¼ã³ããé¸æ
- ãã¯ãã¼ã³ããã¿ã³ãæ¼ã
ããã§ã¯ãã¼ã³ãä½æãããã
è¤è£½å¾ã®è¨å®
è¤è£½ããä»®æ³ãã·ã³ã®è¨å®ãè¡ãã
ãããã¯ã¼ã¯ã®åè¨å®
ãããã¯ã¼ã¯ã«ã¼ãã®MACã¢ãã¬ã¹ãåæåããã®ã§ãä¸è¨ã®ããã«ãã¡ã¤ã«ãç·¨éãã¦NICãåè¨å®ããã
$ cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:f3:a6:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:5a:f7:cb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:bd:de:99", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:2e:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
è¤è£½åã®è¨å®(ä¸2ã¤)ãåé¤ããæ°ããè¨å®(ä¸2ã¤)ã®NAMEãããããeth0, eth1ã«ããã
$ cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:bd:de:99", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:64:2e:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
network-scriptsã®å¤æ´
eth0, eth1ã®ã¹ã¯ãªããã®MACã¢ãã¬ã¹ãå¤æ´ããã
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:bd:de:99
TYPE=Ethernet
UUID=f49787e6-6174-43e3-9aac-bf1929a7cb77
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:64:2e:3d
TYPE=Ethernet
UUID=8f011266-4d43-4e11-be7e-31db6117a531
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
å¤æ´ããã®ã¯HWADDR
ã®å¤ãå
ã»ã©åè¨å®ããNICã®MACã¢ãã¬ã¹(ATTR{address}
)ã¨åãã«ããã
ãããã®è¨å®å¾ãåèµ·åããã
åèµ·åå¾ãifconfigã³ãã³ãã§eth0ã¨eth1ã表示ãããã°OKã