1) ๊ฐ์
- CentOS 6 ์ดํ ๋ฒ์ ์์๋ ๋คํธ์ํฌ ๋๋ฐ์ด์ค๋ช ์ด "eth0"์ฒ๋ผ ํ๊ธฐ๋์์ผ๋, CentOS 7 ๋ถํฐ๋ ๋ณด์์์ ์ด์ ๋ก ens32, enp12 ๋ฑ ๋๋ฐ์ด์ค๋ช ์ด ์ผ๊ด์ ์ด์ง ์๋ค.
- ๋ฐ๋ผ์, ๊ธฐ์กด์ ๋๋ฐ์ด์ค๋ช ์ธ eth0์ฒ๋ผ ํ๊ธฐํ๋ ค๋ฉด grub ํ์ผ์ ์์ ํด์ฃผ์ด์ผ ํ๋๋ฐ ์๋์ ์ ์ฐจ๋๋ก ์งํํด๋ณด์!
- ์ฐธ๊ณ ๋ก, Redhat ๊ณ์ด๊ณผ Debian ๊ณ์ด์ ๋ํด์ ๋ค๋ฃฌ๋ค!
(1) ๊ธฐ์กด ๋คํธ์ํฌ ๋๋ฐ์ด์ค๋ช ํ์ธ
[root@localhost ~]# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.101 netmask 255.255.255.0 broadcast 0.0.0.0
ether 00:0c:29:04:b5:1e txqueuelen 1000 (Ethernet)
RX packets 48 bytes 5850 (5.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35 bytes 6685 (6.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(2) grub ์ค์ ํ์ผ์ ์ต์ ์ถ๊ฐ
vim /etc/default/grub
[์ต์
์ถ๊ฐ ์ ]
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
[์ต์
์ถ๊ฐ ํ]
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
- "/etc/default/grub" ํ์ผ์ "GRUB_CMDLINE_LINUX" ๋ผ์ธ์ "net.ifnames=0 biosdevname=0" ๋ด์ฉ์ ์ถ๊ฐํด์ค๋ค.
(3) grub ๋ถํธ๋ก๋ ์ค์ ์ ์ฉ
[Redhat ๊ณ์ด]
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
done
[Debian ๊ณ์ด]
root@localhost:~# update-grub
(4) ๋คํธ์ํฌ ๋๋ฐ์ด์ค๋ช ๋ณ๊ฒฝ
[Redhat ๊ณ์ด]
cd /etc/sysconfig/network-scripts/
mv ifcfg-ens32 ifcfg-eth0
cat <<EOF > ifcfg-eth0
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=172.20.0.101
PREFIX=24
GATEWAY=172.20.0.1
DNS1=8.8.8.8
EOF
[Debian ๊ณ์ด]
cat <<EOF > /etc/udev/rules.d/70-persistent-net.rules
network:
ethernets:
eth0:
dhcp4: false
addresses:
- 172.20.0.101/24
gateway4: 172.20.0.1
nameservers:
addresses:
- 8.8.8.8
version: 2
EOF
(5) ์ฌ๋ถํ ํ, ๋๋ฐ์ด์ค๋ช ํ์ธ
[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.137 netmask 255.255.255.0 broadcast 172.20.0.255
inet6 fe80::6d62:636c:429f:b2fc prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:04:b5:1e txqueuelen 1000 (Ethernet)
RX packets 75 bytes 8377 (8.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60 bytes 9554 (9.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
๋ฐ์ํ
'๐ ๏ธ Devops > Linux' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[RHEL] Failed to set locale defaulting to c.utf-8 ์ค๋ฅ ํด๊ฒฐ (2) | 2024.06.04 |
---|---|
[CentOS 8, RHEL 8, Rocky 8] rc.local ์๋น์ค ํ์ฑํ (0) | 2023.05.10 |
[CentOS 7.9] PXE Server with KickStart ๊ตฌ์ถ (0) | 2022.07.22 |
[Ubuntu 20.04] APT Mirror ์๋ฒ ๊ตฌ์ถ (1) | 2022.05.04 |
[Ubuntu 20.04] Bonding ์ค์ (2) | 2022.05.04 |