I want my linux (ubuntu 14.04 , 64 bit) system device which has a 3g card in it to have restricted access of internet . I want to build a scenario where if the card is active, the system should be able to connect to any url with the pattern
google.com . Incoming connection won't be a problem. If web address can not be filtered even IP address can also be used .
Is Iptables the answer for it ? . How would we use IP tables to add the rules that will allow traffic only to two sites and not others. I want to do this procedure again and again (like after inserting or removing the card ) . How can I achieve the desired result ?