What's new

UPNP for 2 devices only

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

creatine

Regular Contributor
I currently have 2 playstation consoles in my home network behind traditional NAT using Merlin FW. The issues arises with certain multiplayer games (Call of Duty) that require an "OPEN" nat type for proper matchmaking, lobby gameplay, etc. I would like to avoid placing both consoles in the DMZ or manually forwarding ports to the consoles (I would require a 2nd public IP). I do not want to activate upnp for all devices; is it possible to activate uPNP only for the 2 consoles ?

Does anyone else have a similar setup ?

 
Thanks. Your post led me to some additional searching. The solution is "simple". Give my 2 consoles static IP \ DHCP reservations. Create a upnp.postconf in /jffs/scripts/
Then modify the line:

allow 1024-65535 192.168.1.1/255.255.255.0 1-65535

And change the LAN subnet to the individual IPs of my consoles.

Though, I am a complete scripting noob, this is what I have come up with, can you confirm my syntax is correct

Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

pc_replace "allow 1024-65535 192.168.1.1/255.255.255.0 1-65535" "allow 1024-65535 192.168.1.110/255.255.255.255 1-65535" $CONFIG
pc_insert "allow 1024-65535 192.168.1.1/255.255.255.0 1-65535" "allow 1024-65535 192.168.1.111/255.255.255.255 1-65535" $CONFIG
 
The second line needs to be adjusted to match the changes you made in the first, so
Code:
pc_replace "allow 1024-65535 192.168.1.1/255.255.255.0 1-65535" "allow 1024-65535 192.168.1.110/255.255.255.255 1-65535" $CONFIG
pc_insert "allow 1024-65535 192.168.1.110/255.255.255.255 1-65535" "allow 1024-65535 192.168.1.111/255.255.255.255 1-65535" $CONFIG
 
Excellent. I modified the file, restarted the upnp service and now see the following in

cat /tmp/etc/upnp/config


.
.
presentation_url=https://192.168.1.1:8443/
allow 1024-65535 192.168.1.110/255.255.255.255 1-65535
allow 1024-65535 192.168.1.111/255.255.255.255 1-65535

min_lifetime=120
max_lifetime=86400


Thanks for the help.
 
Just bear in mind that the script will fail if you change the allowed ports ranges in the GUI or the LAN IP address range.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top