save roles to a file
iptables-save /etc/iptables.roles
edit /etc/network/interfaces
vim /etc/network/interfaces
add:
pre-up iptables-restore < /etc/iptables.roles
done.
update:
pre-up
: 网卡启用前的动作
up
: 启用时候的动作
post-up
: 启用后的动作
pre-down
: 关闭前的动作
down
: 关闭时动作
post-down
: 关闭后动作