본문 바로가기 주메뉴 바로가기

자료실

[윈도우]netsh

관리자 2024-11-15 08:36:41 조회수 400

1 개요

윈도우 netsh

network shell, 네트워크 

C:WindowsSystem32netsh.exe

·        윈도우 네트워크 설정 조회/변경 명령어 

2 예시 1: 인터페이스 정보 확인

C:Userszetawiki>netshinterface ip show addresses "무선 네트워크 연결"

 

"무선 네트워크 연결인터페이스에 대한 구성

    DHCP 사용:                         Yes

    IP 주소:                           192.168.0.213

    서브넷 접두사:                        192.168.0.0/24(마스크 255.255.255.0)

    기본 게이트웨이:                        192.168.0.1

    게이트웨이 메트릭:                       0

    인터페이스 메트릭:                      25

3 예시 2: IP 주소 설정

정적 IP 1

netshinterface ip set address local static 123.123.123.123 255.255.255.0

정적 IP 추가

netshinterface ip add address local 234.234.234.234 255.255.255.0

동적 IP 설정

netshinterface ip set address name="로컬 영역 연결" source=dhcp

4 예시 3: 방화벽 열기

C:Userszetawiki>netshadvfirewall firewall add rule name="testrule" dir=in action=allowprotocol=tcp localport=1234,5678

확인됨

→ 1234 포트와 5678 포트를 열어줌 (규칙명: testrule)

5 예시 4: DNS 확인

C:Userszetawiki>netshinterface ipv4 show dnsservers

 

"무선 네트워크 연결인터페이스에 대한 구성

    정적으로 구성된 DNS 서버:    8.8.8.8

                                         8.8.4.4