AIX IP 설정

GENERAL/Network2021. 10. 9. 17:53
반응형
 
=== Written by Jung Byung Wook ===
 
  • AIX에서 Network Interface에 IP 설정하는 방법 기술

1. IP 할당할 인터페이스 확인

  • 어떤 인터페이스에 IP를 할당할지 확인.
  • Network랑 통신하는 Interface의 device name은 "ent"로 시작.
  • ent에 해당하는 Device만 IP할당이 가능.
1
2
3
4
5
6
7
8
9
10
[his-jbw:root] /etc > lsdev -Cc adapter |grep -i ent
ent0     Available 02-00 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent1     Available 02-01 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent2     Available       Virtual I/O Ethernet Adapter (l-lan)
ent3     Available       Virtual I/O Ethernet Adapter (l-lan)
ent4     Available       Virtual I/O Ethernet Adapter (l-lan)
ent5     Available       Virtual I/O Ethernet Adapter (l-lan)
ent6     Available       Logical Host Ethernet Port (lp-hea)
ent7     Available       Shared Ethernet Adapter
ent8     Available       Shared Ethernet Adapter
 
 

 

2. 단순 IP 할당

  • 방법1 : smitty chinet
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
+--------------------------------------------------------------------------+
|                       Available Network Interfaces                       |
|                                                                          |
| Move cursor to desired item and press Enter.                             |
|                                                                          |
|   en0   02-00   Standard Ethernet Network Interface                      |
|   ---------------------------------------------------  "en0 선택"        |
|   en1   02-01   Standard Ethernet Network Interface                      |
|   en2           Standard Ethernet Network Interface                      |
|   en3           Standard Ethernet Network Interface                      |
|   en4           Standard Ethernet Network Interface                      |
|   en5           Standard Ethernet Network Interface                      |
|   en6           Standard Ethernet Network Interface                      |
|   en7           Standard Ethernet Network Interface                      |
|   en8           Standard Ethernet Network Interface                      |
|   et0   02-00   IEEE 802.3 Ethernet Network Interface                    |
|   et1   02-01   IEEE 802.3 Ethernet Network Interface                    |
|   et2           IEEE 802.3 Ethernet Network Interface                    |
|   et3           IEEE 802.3 Ethernet Network Interface                    |
|   et4           IEEE 802.3 Ethernet Network Interface                    |
|   et5           IEEE 802.3 Ethernet Network Interface                    |
|   et6           IEEE 802.3 Ethernet Network Interface                    |
|   et7           IEEE 802.3 Ethernet Network Interface                    |
|   et8           IEEE 802.3 Ethernet Network Interface                    |
|                                                                          |
| F1=Help                 F2=Refresh              F3=Cancel                |
| F8=Image                F10=Exit                Enter=Do                 |
| /=Find                  n=Find Next                                      |
+--------------------------------------------------------------------------+
 
           Change / Show a Standard Ethernet Interface
                                                                                                         
 
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
  Network Interface Name                              en0
  INTERNET ADDRESS (dotted decimal)                  [10.0.0.81]       <- IP 주소 지정.
  Network MASK (hexadecimal or dotted decimal)       [255.255.255.0]   <- Network netmask 지정
  Current STATE                                       up               <- detach 상태를 yes로 변경.                                                                                        
  Use Address Resolution Protocol (ARP)?              yes     
  BROADCAST ADDRESS (dotted decimal)                 []
  Interface Specific Network Options
    ('NULL' will unset the option)
    rfc1323                                          []
    tcp_mssdflt                                      []
    tcp_nodelay                                      []
    tcp_recvspace                                    []
    tcp_sendspace                                    []
  Apply change to DATABASE only                       no                                                                                              
 
 

 

  • 방법2 : chdev 명령어
1
[his-jbw:root] / > chdev -l en1 -a netaddr=10.0.0.81 -a netmask=255.255.255.0 -a state=up
 

 

3. Default Gateway 지정 및 IP 할당

  • 방법 : smitty mktcpip
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
+--------------------------------------------------------------------------+
|                       Available Network Interfaces                       |
|                                                                          |
| Move cursor to desired item and press Enter.                             |
|                                                                          |
|   en0   02-00   Standard Ethernet Network Interface                      |
|   ---------------------------------------------------  "en0 선택"        |
|   en1   02-01   Standard Ethernet Network Interface                      |
|   en2           Standard Ethernet Network Interface                      |
|   en3           Standard Ethernet Network Interface                      |
|   en4           Standard Ethernet Network Interface                      |
|   en5           Standard Ethernet Network Interface                      |
|   en6           Standard Ethernet Network Interface                      |
|   en7           Standard Ethernet Network Interface                      |
|   en8           Standard Ethernet Network Interface                      |
|   et0   02-00   IEEE 802.3 Ethernet Network Interface                    |
|   et1   02-01   IEEE 802.3 Ethernet Network Interface                    |
|   et2           IEEE 802.3 Ethernet Network Interface                    |
|   et3           IEEE 802.3 Ethernet Network Interface                    |
|   et4           IEEE 802.3 Ethernet Network Interface                    |
|   et5           IEEE 802.3 Ethernet Network Interface                    |
|   et6           IEEE 802.3 Ethernet Network Interface                    |
|   et7           IEEE 802.3 Ethernet Network Interface                    |
|   et8           IEEE 802.3 Ethernet Network Interface                    |
|                                                                          |
| F1=Help                 F2=Refresh              F3=Cancel                |
| F8=Image                F10=Exit                Enter=Do                 |
| /=Find                  n=Find Next                                      |
+--------------------------------------------------------------------------+
 
                     Minimum Configuration & Startup
                                                                                                                                                                                                      
   To Delete existing configuration data, please use Further Configuration menus
 
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
* HOSTNAME                                           [his-jbw]     <- hostname
* Internet ADDRESS (dotted decimal)                  [10.0.0.81]   <- IP 주소
  Network MASK (dotted decimal)                      [255.255.255.0]  <- Netmask
* Network INTERFACE                                   en0
  NAMESERVER
           Internet ADDRESS (dotted decimal)         []
           DOMAIN Name                               []
  Default Gateway
       Address (dotted decimal or symbolic name)     [10.0.0.1]       <- Default Gateway
       Cost                                          [0]                                                                                                              
       Do Active Dead Gateway Detection?              no                                                                                                              
  Your CABLE Type                                     N/A                                                                                                             
  START TCP/IP daemons Now                            no                                                                                                              
cs

 

4. IP 할당 내역 및 Default gateway 확인

  • IP할당 내역 확인 : #ifconfig -a
1
2
3
4
5
6
7
8
9
[his-jbw:root] / > ifconfig -a
en0: flags=1e080863,400c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 10.0.0.81 netmask 0xffffff00 broadcast 10.0.0.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
 
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
 
 

 

  • Default gateway 확인 : #netstat -rn
1
2
3
4
5
6
7
8
9
10
11
12
[his-jbw:root] / > netstat -rn
Routing tables
Destination        Gateway           Flags   Refs     Use  If   Exp  Groups
Route tree for Protocol Family 2 (Internet):
default            10.0.0.1          UG        0    133794 en0      -      -   
10.0.0.0           10.0.0.81         UHSb      0         0 en0      -      -   =>
10/24              10.0.0.81         U         0    953262 en0      -      -   
10.0.0.81          127.0.0.1         UGHS      0         2 lo0      -      -   
10.0.0.255         10.0.0.81         UHSb      0         4 en0      -      -   
127/8              127.0.0.1         U        16   8836890 lo0      -      -   
Route tree for Protocol Family 24 (Internet v6):
::1%1              ::1%1             UH        0    501153 lo0      -      -   
 
반응형

'GENERAL > Network' 카테고리의 다른 글

AIX Socket 종료(rmsock)  (0) 2021.10.08
AIX 특정 서비스 포트를 사용하는 프로세스 확인  (0) 2021.10.03
Posted by 정병욱

반응형

1. Socket 종료(Close)

  • Socket을 종료할수 있는 조건

    ▹ 해당 Socket이 사용중인 파일이 없어야 함.

    ▹ 연관 프로세스가 종료된 상태여야 함.

    ▹ Socket의 상태가 LISTEN / ESTABLISHED 등 프로세스와 직접적인 통신이 수행되고 있는 경우에는 Socket 종료 불가.

    ▹ 일반적으로 프로세스가 완전 종료되는 시점에서 Socket은 모두 정리된다.

   

  • 주의 사항 : Socket을 수동으로 종료할때, Kernel과 관련된 프로세스일 경우 Kernel crash 발생 가능성있음.
  • rmsock 수행로직

    ▹ Scoket과 연관된 프로세스에서 열린 파일이 있는지 검사.

    ▹ 열려있는 파일이 없으면, Socket 종료.

    ▹ 만약, 열려있는 파일이 있으면, syslogd에 내용이 전달되며, /var/adm/ras/rmsock.log 파일에 기록됨.

 

  • Socket 종료 방법
1
2
3
4
5
[his-jbw:root] / > netstat -aAn|grep "\.443"
f100060000bedb98 tcp4       0      0  *.443              *.*                LISTEN
 
[his-jbw:root] / > rmsock f100060000bedb98  tcpcb
 
 
 

 

2. Socket  Close가 안될때, 확인방법

  • 위에서 언급한 Socket 종료조건이 충족되지 않으면, 정상 Socket close는 불가능하다.
  • rmsock 명령어를 사용했을 때, command prompt에 조건에 의해서 rmsock 명령어 수행이 불가한지 내용이 출력되지만, /var/adm/ras/rmsock.log에도 해당 내용이 기록된다.

    ▹ 메세지1 : socket 0xf1000f00002ac808 held by process 7012626 (sshd) can't be removed.

    ▹ 메세지2 : Wait for exiting processes to be cleaned up before removing the socket

 

1
2
3
4
5
6
7
8
9
[his-jbw:root] / > cat /var/adm/ras/rmsock.log
socket 0xf1000f00002ac808 held by process 7012626 (sshd) can't be removed.
socket 0xf1000f00002ab008 held by process 7012626 (sshd) can't be removed.
socket 0xf1000f00003e0808 held by process 6160892 (httpd) can't be removed.
socket 0xf1000f00003f3808 held by process 3670430 (snmpdv3ne) can't be removed.
socket 0xf1000f00003e1808 held by process 6160892 (httpd) can't be removed.
socket 0xf1000f0004316008 held by process 4587970 (inetd) can't be removed.
socket 0xf1000f00003fa808 held by process 6881552 (rmcd) can't be removed.
 
 
 

 

 

반응형

'GENERAL > Network' 카테고리의 다른 글

AIX IP 설정  (0) 2021.10.09
AIX 특정 서비스 포트를 사용하는 프로세스 확인  (0) 2021.10.03
Posted by 정병욱

반응형

 



 
* Written by Jung Byung Wook
 

 

1. lsof 명령어로 특정 서비스 포트 사용하는 프로세스 확인

1
2
3
4
5
6
7
8
9
10
[his-jbw:root] /etc > lsof -i TCP:23
lsof: WARNING: compiled for AIX version 6.1.3.0; this is 6.1.0.0.
COMMAND     PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
inetd   2032034 root    9u  IPv6 0xf100050000529bb8      0t0  TCP *:telnet (LISTEN)
telnetd 3211574 root    0u  IPv6 0xf1000500001653b8    0t213  TCP his-jbw:telnet->192.168.0.54:12516 (ESTABLISHED)
telnetd 3211574 root    1u  IPv6 0xf1000500001653b8    0t213  TCP his-jbw:telnet->192.168.0.54:12516 (ESTABLISHED)
telnetd 3211574 root    2u  IPv6 0xf1000500001653b8    0t213  TCP his-jbw:telnet->192.168.0.54:12516 (ESTABLISHED)
telnetd 4587556 root    0u  IPv6 0xf100050000165bb8    0t213  TCP his-jbw:telnet->192.168.0.54:fyre-messanger (ESTABLISHED)
telnetd 4587556 root    1u  IPv6 0xf100050000165bb8    0t213  TCP his-jbw:telnet->192.168.0.54:fyre-messanger (ESTABLISHED)
telnetd 4587556 root    2u  IPv6 0xf100050000165bb8    0t213  TCP his-jbw:telnet->192.168.0.54:fyre-messanger (ESTABLISHED)
 
  • lsof 명령어는  AIX 기본 명령어가 아니며, "AIX Expansion pack"에서 별도로 설치해줘야한다.
  • [lsof.base, lsof.license, lsof.man.en_US] 파일셋을 설치.

 

2. netstat 명령어로 특정 서비스 포트 사용하는 프로세스 확인

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
[his-jbw:root] / > netstat -aAn|grep "\.443"
f100060000bedb98 tcp4       0      0  *.443              *.*                LISTEN
 
[his-jbw:root] / > kdb
(0)> sockinfo f100060000bedb98 tcpcb
 
---- TCPCB ----(@ F100060000BEDB98)----
    seg_next......@F100060000BEDB98  seg_prev......@F100060000BEDB98
    t_softerror... 00000000 t_state....... 00000004 (ESTABLISHED)
    t_timer....... 00000000 (TCPT_REXMT)
    t_timer....... 00000000 (TCPT_PERSIST)
    t_timer....... 00003508 (TCPT_KEEP)
 
..... 제일 끝 화면의 PID정보 확인....
 
proc/fd:  90/323
 
proc/fd: fd: 323
SLOT NAME     STATE      PID    PPID          ADSPACE  CL #THS
pvproc+017400   90*httpds   ACTIVE 005D0BC 004901E 00000001144C1400
 
(0)> hcal 005A0022
Value hexa: 005A0022          Value decimal: 5898274
 
[his-jbw:root] / > ps -ef |grep 5898274
    root 5898274  004901E   0   Jan 20      -  0:05 /usr/sbin/httpds    <---  해당 port를 사용중인 application
 
  • netstat 명령어로 서비스 포트 검색.
  • netstat 명령어(netstat -Aan)에서 출력되는 첫번째 컬럼이 Socket address.
  • kdb 명령어로, 해당 Socket 정보 확인
  • Socket 정보에서 제일 하단에 해당 Socket의 사용 프로세스 ID 출력.
  • 프로세스 ID(16진수) > 10진수로 변환.
  • ps -ef 명령어로 해당 프로세스 조회.
반응형

'GENERAL > Network' 카테고리의 다른 글

AIX IP 설정  (0) 2021.10.09
AIX Socket 종료(rmsock)  (0) 2021.10.08
Posted by 정병욱