IBM i - LAN basic setup

By kimot, 5 January, 2024

To setup LAN on your system you must have licenced program 57xxTC1 (IBM TCP/IP Connectivity Utilities for i5/OS) installed.
You can check it with command NETSTAT. If the menu Work with TCP/IP Network Status appears you can start with TCP/IP configuration.

You must also have a switch connected to the port you want to use.

First thing you need is defined *ELAN Line description.
With command WRKLIND you can show all defined Line descriptions on your system

                         Work with Line Descriptions  
                                                            System:   S6583390
Position to  . . . . .                Starting characters                     
                                                                              
Type options, press Enter.                                                    
  2=Change   3=Copy    4=Delete   5=Display   6=Print   7=Rename              
  8=Work with status   9=Retrieve source                                      
                                                                              
Opt  Line        Type        Text                                             
     QESLINE     *SDLC                                                        
     QTILINE     *SDLC                                                        

If *ELAN is missing you can create one with command CRTLINETH but you have to know Hardware resource name :

WRKHDWRSC TYPE(*CMN)

will show list of Communication Resources on your system

                      Work with Communication Resources                       
                                                            System:   S6583390
Type options, press Enter.                                                    
  5=Work with configuration descriptions   7=Display resource detail          
                                                                              
Opt  Resource        Type  Status                Text                         
     CMB02           268C  Operational           Combined function IOP        
       LIN01         6B03  Operational           Comm Adapter                 
         CMN01       6B03  Operational           Comm Port                    
       LIN02         6B03  Operational           Comm Adapter                 
         CMN02       6B03  Operational           Comm Port                    
     CMB04           5706  Operational           Comm Processor               
       LIN03         5706  Operational           LAN Adapter                  
         CMN03       5706  Operational           Ethernet Port                
         CMN04       5706  Operational           Ethernet Port                
     CMB05           2793  Operational           Comm Processor               
       LIN04         2793  Operational           Comm Adapter                 
         CMN05       2793  Operational           Comm Port                    
         CMN06       2793  Operational           Comm Port                    

Ethernet Ports are what you are looking for.

CRTLINETH LIND(ETH0) RSRCNAME(CMN03) LINESPEED(*AUTO) DUPLEX(*AUTO) TEXT('Ethernet line 0')

Enable datagram forwarding

CHGTCPA IPDTGFWD(*YES)

type command CFGTCP and select option 1. Work with TCP/IP interfaces

                         Work with TCP/IP Interfaces                          
                                                            System:   S6583390
Type options, press Enter.                                                    
  5=Display   9=Start   10=End                                                
                                                                              
     Internet         Subnet              Line      Line                      
Opt  Address          Mask             Description  Type                      
                                                                              
     127.0.0.1        255.0.0.0        *LOOPBACK    *NONE                     

Put 1 (Add) in Opt field and pres Enter

                       Add TCP/IP Interface (ADDTCPIFC)                       
                                                                              
Type choices, press Enter.                                                    
                                                                              
Internet address . . . . . . . . > '192.168.2.220'                            
Line description . . . . . . . . > ETH0          Name, *LOOPBACK...           
Subnet mask  . . . . . . . . . . > '255.255.255.0'                            
Alias name . . . . . . . . . . .   *NONE                                      
Associated local interface . . .   *NONE                                      
Type of service  . . . . . . . .   *NORMAL       *MINDELAY, *MAXTHRPUT...     
Maximum transmission unit  . . .   *LIND         576-16388, *LIND             
Autostart  . . . . . . . . . . .   *YES          *YES, *NO                    
PVC logical channel identifier                   001-FFF                      
               + for more values                                              
X.25 idle circuit timeout  . . .   60            1-600                        
X.25 maximum virtual circuits  .   64            0-64                         
X.25 DDN interface . . . . . . .   *NO           *YES, *NO                    
TRLAN bit sequencing . . . . . .   *MSB          *MSB, *LSB                   
                                                                              
                                                                              
                                                                        Bottom
F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display   
F24=More keys                                                                                   

TCP/IP interface should be created

                          Work with TCP/IP Interfaces                           
                                                             System:   S6583390
 Type options, press Enter.                                                    
   5=Display   9=Start   10=End                                                
                                                                               
      Internet         Subnet              Line      Line                      
 Opt  Address          Mask             Description  Type                      
                                                                               
      127.0.0.1        255.0.0.0        *LOOPBACK    *NONE                     
      192.168.2.220    255.255.255.0    ETH0         *ELAN                     

Then use option 9=Start on this interface

You can check the result by pinging the corresponding IP address from another device.