# drop all inbound/outbound packet for this specific interface#
$ iptables -I DOCKER-USER -i $interface -j DROP
# allow outbound packet for this specific interface
$ iptables -I DOCKER-USER -o $interface -j ACCEPT
# accept inbound packet for this specific interface as long as
# a connection has alread# y been made
$ iptables -I DOCKER-USER -i $interface -m state --state ESTABLISHED,RELATED -j ACCEPT
# allow inbound packet from IP $arg for this specifc interface
$ iptables -I DOCKER-USER -i $interface -s $arg -j ACCEPT
# allow outbound packet toward $arg for this specific interface as long as
# a connection has already been made
$ iptables -I DOCKER-USER -o $interface -d $arg -m conntrack --ctstate RELATED,ESTABLISHED
# check new rules
$ iptables -S DOCKER-USER