티스토리 뷰

IT/Linux

[Linux][CentOS7] ipv6 비활성화

주인장 진빼이

네트워크 인터페이스 ipv6 사용 확인

ifconfig 명령어를 이용하여 ipv6가 활성화 되어 있는지 확인할 수도 있다.
각 인터페이스에 inet6 항목을 확인하자.

$ ifconfig

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.0.0.2  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 xxxx::xxxx:fe00:c1d  prefixlen 64  scopeid 0x20<link>
        ether xx:xx:17:00:0c:1d  txqueuelen 1000  (Ethernet)
        RX packets 36728  bytes 50635128 (48.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 29973  bytes 11240303 (10.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
# ... 생략

ipv6_disable 사용 여부 확인

다음 명령어를 통해 ipv6 사용 여부를 확인한다.
네트워크 인터페이스(ens3, docker0, lo)가 여러개인 경우 더 많은 항목이 표시된다.
(0 = ipv6 활성화, 1 = ipv6 비활성화)

$ sysctl -a | grep disable_ipv6

net.ipv6.conf.all.disable_ipv6 = 0
sysctl: reading key "net.ipv6.conf.all.stable_secret"
sysctl: reading key "net.ipv6.conf.default.stable_secret"
net.ipv6.conf.default.disable_ipv6 = 0
sysctl: reading key "net.ipv6.conf.docker0.stable_secret"
net.ipv6.conf.docker0.disable_ipv6 = 0
sysctl: reading key "net.ipv6.conf.ens3.stable_secret"
net.ipv6.conf.ens3.disable_ipv6 = 0
sysctl: reading key "net.ipv6.conf.lo.stable_secret"
net.ipv6.conf.lo.disable_ipv6 = 0

ipv6_disable 비활성화하기

ipv6를 비활성화 하기 위해서는 net.ipv6.conf.<interface>.disable\_ipv6 값을 1로 변경한다.
ens3 인터페이스에서 사용 중인 ipv6를 비활성화 하려면 다음 명령어를 사용하여 설정한다.

$ sysctl -w net.ipv6.conf.ens3.disable_ipv6=1

net.ipv6.conf.ens3.disable_ipv6 = 1

모든 네트워크 인페이스를 대상으로 하는 경우 인터페이스명 대신에 all을 사용한다.

$ sysctl -w net.ipv6.conf.all.disable_ipv6=1

net.ipv6.conf.all.disable_ipv6 = 1

/etc/sysctl.conf 파일을 수정하여 재부팅 후에도 계속 적용될 수 있게 변경한다.

$ vi /etc/sysctl.conf

# 편집 모드 (내용 추가)
net.ipv6.conf.all.disable_ipv6 = 1
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함