안녕하세요. 

 

오늘은 CMD 기초 명령어에 대해서 알아보겠습니다.

 

computer hostname 확인

C:\Users\Administrator>hostname
FIRST

 

computer hostname 변경

C:\Users\Administrator>hostname
FIRST

C:\Users\Administrator>netdom renamecomputer %COMPUTERNAME% /newname:SERVER01
This operation will rename the computer FIRST
to SERVER01.

Certain services, such as the Certificate Authority, rely on a fixed machine
name. If any services of this type are running on FIRST,
then a computer name change would have an adverse impact.

Do you want to proceed (Y or N)?
y
The computer needs to be restarted in order to complete the operation.

The command completed successfully.


C:\Users\Administrator>

 

PC가 재부팅되어야지 적용 됩니다.

재부팅 명령어

 

shutdown /r /t 0

 

재부팅이 완료 되면 hostname명령어로 서버 호스트 이름을 확인 합니다.

아래처럼 변경 되었습니다. 

C:\Users\Administrator>
C:\Users\Administrator>hostname
SERVER01

 

IP주소 확인 명령어

C:\Users\Administrator>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::dc7a:b75c:a36c:5fe4%11
   IPv4 Address. . . . . . . . . . . : 192.168.10.193
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.10.253

C:\Users\Administrator>

 

IP주소 상세하게 확인 하는 방법

C:\Users\Administrator>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : SERVER01
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
   Physical Address. . . . . . . . . : 00-0C-29-21-0B-1B
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::dc7a:b75c:a36c:5fe4%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.10.193(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.10.253
   DHCPv6 IAID . . . . . . . . . . . : 100666409
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2F-05-E4-8C-00-0C-29-21-0B-1B
   DNS Servers . . . . . . . . . . . : 8.8.8.8
                                       8.8.4.4
   NetBIOS over Tcpip. . . . . . . . : Enabled

C:\Users\Administrator>

 

CMD 모드에서 IP주소 변경하는 방법

현재 Ethernet0이 Index 번호는 11

C:\Users\Administrator>netsh
netsh>interface ipv4 show interface

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  1          75  4294967295  connected     Loopback Pseudo-Interface 1
 11          25        1500  connected     Ethernet0

netsh>

 

아래 처럼 CMD에서도 IP주소랑 DNS를 변경 가능 합니다. 

netsh>interface ipv4 set address name="11" source=static address=192.168.10.x mask=255.255.255.0 gateway=192.168.10.253
netsh>interface ipv4 add dnsserver name="11" address=8.8.8.8 index=1

 

Server Routing Table 확인 하는 명령어

C:\Users\Administrator>route print
===========================================================================
Interface List
 11...00 0c 29 21 0b 1b ......Intel(R) 82574L Gigabit Network Connection
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0   192.168.10.253   192.168.10.193    281
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     192.168.10.0    255.255.255.0         On-link    192.168.10.193    281
   192.168.10.193  255.255.255.255         On-link    192.168.10.193    281
   192.168.10.255  255.255.255.255         On-link    192.168.10.193    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link    192.168.10.193    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link    192.168.10.193    281
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0   192.168.10.253  Default
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    331 ::1/128                  On-link
 11    281 fe80::/64                On-link
 11    281 fe80::dc7a:b75c:a36c:5fe4/128
                                    On-link
  1    331 ff00::/8                 On-link
 11    281 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

C:\Users\Administrator>

 

 

+ Recent posts