본문 바로가기

리눅스

[draft] 우분투에서 IPv6를 영구적으로 비활성화하는 방법

728x90

우분투에서 IPv6를 영구적으로 비활성화하는 방법

sysctl 설정을 통한 비활성화

sysctl 설정 파일 수정

sudo vim /etc/sysctl.conf

IPv6 비활성화 설정 추가

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

변경 사항 적용(즉시 적용)

sudo sysctl -p

IPv6 비활성화 확인

ip a | grep inet6
728x90

GRUB 설정을 통한 비활성화

GRUB 설정 파일 수정

sudo vim /etc/default/grub

GRUB 설정에 IPv6 비활성화 옵션 추가

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"

또는

GRUB_CMDLINE_LINUX="ipv6.disable=1"

GRUB 설정 업데이트

sudo update-grub

시스템 재부팅

sudo reboot

IPv6 비활성화 확인

ip a | grep inet6

(참고) 특정 네트워크 인터페이스에서만 IPv6를 비활성화하는 방법

  • net.ipv6.conf.INTERFACE_NAME.disable_ipv6 = 1 설정을 사용할 수 있습니다
  • (INTERFACE_NAME은 eth0, lo 등 인터페이스 이름으로 대체합니다).
net.ipv6.conf.INTERFACE_NAME.disable_ipv6 = 1

 

728x90