I'm not sure what is happening but 198.18.1.1 is not an IP address for facebook as it is part of a reserved set of IP addresses.
I believe this IP Address can be returned by some routers when DNS fails (known as a spoof list). You should be able to do more test by trying other sites when this happens. If the IP address returned keeps going up by one each time, it is being spoofed (like 198.18.1.2 for the next ping/nslookup).
My feeling is that your DNS could be failing, possibly at your ISP level.
Some things you could try:
"ping openwrt.org" after facebook to see if IP goes up by 1
ping an IP address directly to see if only DNS is failing (ping 216.58.213.3 from your example)
"nslookup facebook.com" when the issue happens (you should get a failure aka 198.18.1.1)
"nslookup facebook.com 8.8.8.8" this will force the use of Google DNS and if this works, you know that it is your current DNS setup that is failing
Hi guys thanks for the replies. It was indeed a DNS issue although it was the old Vodafone router I had setup as a Wi-Fi AP on the network. I had forgot to disable the IPv6 functionality on it and it was dishing out IPv6 DNS server addresses out to the clients on my network. So when accessing sites it would try to request a DNS from an AP that doesn't have direct internet access. As soon as I disabled IPv6 on the Vodafone AP everything is now working as it should