IP Address of AS/400

35 pts.
AS/400 IP address
IP address
iseries v5r4
How to find the IP address of a given AS/400 machine?

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

Enter NETSTAT and select option 1.
Or CFGTCP option 10
You can also ping your system name:
ping yoursysname
It will return the ip address of the machine.

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    The question might be too vague. Is it asking how to find the IP address of a remote AS/400? Is it asking how to code a program to find the IP address of the system that the program runs on? Is it asking how to find what IP address is in use by default within an AS/400? Is it asking how to find what IP address is associated with an AS/400 host name? Is it asking how to find what the host name is of "this" AS/400? Lots of variations are possible. An AS/400 may have many possible host names and many IP addresses. The addresses may be distributed across multiple NICs or assigned to a single NIC. An AS/400 may have "virtual" addresses... The simple answer given is the most direct and is as good as any, given how vague the question is. Many other answers are possible -- especially if the TCP/IP configuration isn't correct in the first place. Tom
    125,585 pointsBadges:
  • WoodEngineer
    Ping is a nice simple way to do this and works well. This is the result of pinging an AS/400 from my PC:
    H:>ping srpin270
    Pinging srpin270 [] with 32 bytes of data:
    Reply from bytes=32 time=35ms TTL=28
    Reply from bytes=32 time=39ms TTL=28
    Reply from bytes=32 time=25ms TTL=28
    Reply from bytes=32 time=26ms TTL=28
    Ping statistics for
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 25ms, Maximum = 39ms, Average = 31ms
    8,225 pointsBadges:
  • PercySuarez
    Hi, I need to code a program to find the IP address of the iSeries where the program runs on, one friend told me to use MYIP but i don't find this command.
    10 pointsBadges:
  • Gayathri123
    Hi, Use the command CFGTCP and select option 1-> Work with TCP/IP Interfaces , the resultant screen will have your system IP.

    Please refer the thread which has the required details,

    925 pointsBadges:
  • TheRealRaven
    The first requirement is the "AS/400" is properly configured. I doubt if I've seen more than one out of four "AS/400s" that had a cleanly correct TCP/IP configuration.

    However, you should be able to start by calling the gethostname() API to obtain the system's fully-qualified host name. With that name, you should be able to call the gethostbyname() API to retrieve the network address. Then use the inet_ntoa() API to translate the network address (32-bit integer) into dotted-decimal form. (Slight changes are needed if IPv6 is used.)

    You might also do at least minor configuration verification by calling the QtocRtvTCPA() API to check the configured domain and host names against the fully-qualified name retrieved above.
    36,420 pointsBadges:
  • betolo
    An old school CLP pgm could do this...PGM
    DCL        VAR(&IPNBR) TYPE(*CHAR) LEN(15)      
    DCL        VAR(&RECEIVER) TYPE(*CHAR) LEN(1000) 
    DCL        VAR(&RCVLEN) TYPE(*CHAR) LEN(4)      
    DCL        VAR(&DEVICE) TYPE(*CHAR) LEN(10)     
    CHGVAR     VAR(%BIN(&RCVLEN)) VALUE(1000)           
    RTVJOBA    JOB(&DEVICE)                             
                    'DEVD0600' &DEVICE X'00000000')        
    &IPNBR will have the IP-address of the server you ran this on.
    10 pointsBadges:
  • TheRealRaven
    @betolo: Though the program will usually work correctly when called from an interactive job, that might not be the appropriate environment. It could probably be modified to work in batch, but care is needed to choose a device that is at least varied on (and runs against TCP/IP).
    36,420 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: