If you did port forwarding or DMZ for your PS3, you will have to change those settings for your PS4. Some of the ports will be the same, and you can't forward the same port to multiple IPs. I would check the port forwarding of the router, and delete all old entries for your PS3. After that, if it's a newer router, UPnP should be all you need. If that doesn't work, you will need to port forward or put the PS4 in a DMZ. In either case, you must first assign your PS4 a static IP. DMZ opens your PS4 to internet traffic, essentially bypassing the router. If you go the port forwarding route, here are some ports to forward to get you started:
TCP: 1116-1150, 28910
UDP: 1116-1150, 5165, 27900-27901
Other than that, make sure you are hard wired.
If you need help forwarding ports for your router, check portforward.com
Having two consoles connected to the same router causes problems, especially when the same ports are needed.
Give the following link a read. I would suggest port forwarding your PS4 and placing the PS3 into the DMZ.