I had problems using two TCPIP stacks so I thought I would document what I did to get it working. The short answer is I needed ALTER QMGR TCPSTACK(MULTIPLE)
Before I started I looked a the syntax of the START LISTENER command.
With NETSTAT you use tso netstat home TCP TCPIP2
Where as with MQ you use MQPA STA LSTR PORT(6410) <IPADDR(WINMVSCA)>
and specify an IP address rather than a TCP stack name. This is because the TCP bind requests requires an IP address and not a stack name.
My TCPIP stack had address winmvsca.HURSLEY.IBM.COM 188.8.131.52
if I used mqpa sta lstr port(6410)
The MQPA DIS CHINIT command gave
CSQX846I MQPA CSQXRDQM TCP/IP listener INDISP=QMGR started for port 6410 address
If I used MQPA STA LSTR PORT(6410) IPADDR(WINMVSCA) this also worked and DIS CHINIT gave me
CSQX846I MQPA CSQXRDQM TCP/IP listener INDISP=QMGR started for port 6410 address WINMVSCA
So this worked fine.
I had to use a port on a different TCP stack called TCPIP2 with address WINMVSCAT2.HURSLEY.IBM.COM 184.108.40.206I
I tried both
MQPA START LSTR PORT(1414) IPADDR(WINMVSCAT2.HURSLEY.IBM.COM)
MQPA STA LSTR PORT(6410) IPADDR(220.127.116.11)
+CSQX218E MQPA CSQXLSTT Listener not started - unable to bind, port 1414 address 18.104.22.168 TRPTYPE=TCP INDISP=QMGR, RC=0000045C
RC=0456 ( 456) means Cannot assign requested address
I shut down the CHINIT and told it to use TCPIP2 Stack using the command
MQPA ALTER QMGR TCPNAME(TCPIP2)
I restarted the chinit - and the listener for port 1414 worked - but the listener for port 6410 did not work.
I then found Ihad to use
MQPA ALTER QMGR TCPSTACK(MULTIPLE) TCPNAME(TCPIP)
I restarted the chinit and both listeners started.
MQPA Dis chinit gave me
CSQX846I MQPA CSQXRDQM TCP/IP listener INDISP=QMGR started, for port 6410 address WINMVSCA
CSQX846I MQPA CSQXRDQM TCP/IP listener INDISP=QMGR started for port 1414 address WINMVSCAT2.HURSLEY.IBM.COM
So I needed the TCPSTACK(MULTIPLE) for this to work
Someone asked me why I needed two TCPIP stacks.
I have one stack for normal day to day work, and a stack which I can experiment with. A Dynamic VIPA had been set up on my experimental stack. A more common reason might be to have external traffic coming on on one stack, and internal traffic on a differnet stack.