I have a router that runs Tomato, so I have access to
iptables. There's a device on my network with an IP address of 192.168.1.100. I don't want it to send data to the Internet except for a very specific case.
Specifically, I don't want it to send outgoing data to the Internet at all except for secure SMTP (TCP port 587 or 465) and even then, just to one SMTP server. Incoming traffic is a concern too, but blocking outbound is more important. It should continue to allow LAN traffic, so packets with an origin and destination of 192.168.1.0/24 are fine.
I don't know much about
iptables so I'm not sure how to go about doing this, or if
iptables is even the best approach. I've set up rules before that drop packets, but I've never set one up that blocks everything but packets that meet specific requirements.
How would you suggest I go about doing this?