How can I configure iptables firewall on my Ubuntu virtual machine that has IP address 192.168.36.51 to allow a webserver running on port 8888 on the host machine to be only accessible from another machine on the network with the following IP address 192.168.36.202.
Considering the firewall is running the default settings.
I have a virtual lab that has Kali Linux, Windows 8 and Ubuntu. On the Ubuntu I have apache server running and I did this command to block the traffic:
sudo iptables -A INPUT -p tcp -s 192.168.36.202 --dport 8888 -j ACCEPT
sudo iptables -A OUTPUT -d 192.168.36.202 -j ACCEPT
sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT DROP