Im using ubuntu 18.04 and successfully setup nginx and uwsgi to host multiple websites.
I have an AAAA record mapped to an IPV6 address through my DNS provider, and I have my nginx config file listening on ports 80 and 443 for that IPV6 address.
This setup is working just fine.
However, I would like to restrict IPV6 traffic to ports 80 and 443 to ONLY a few specific IP addresses.
When I list the current ip6table rules using ip6tables -S, there is a line towards the bottom like this.
-A ufw6-user-input -p tcp -m multiport --dports 80,443 -m comment --comment "\'dapp_Nginx%20Full\'" -j ACCEPT
I am new to iptables in general but from all the reading and tutorials I have done it sounds like:
- You need to make sure rules are in the correct order.
- You want to save the rules to a file before making changes in case you screw something up.
- After you have your rules the way you want them you want to use something like the persistent flag so the rules persist in event of reboot.
My question is what rules would i need to have to achieve the stated goal above, and in what order, and will this only apply to ipv6 traffic on the 80/443 ports?
foo@example:~# sudo ufw status verbose Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To Action From -- ------ ---- 22/tcp (OpenSSH) ALLOW IN Anywhere 80,443/tcp (Nginx Full) ALLOW IN Anywhere 22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6) 80,443/tcp (Nginx Full (v6)) ALLOW IN Anywhere (v6)