Skip to content

Instantly share code, notes, and snippets.

@ViKingIX
Last active December 21, 2016 09:36
Show Gist options
  • Save ViKingIX/dcb7eaf7859165e21bb64d66b772e2a4 to your computer and use it in GitHub Desktop.
Save ViKingIX/dcb7eaf7859165e21bb64d66b772e2a4 to your computer and use it in GitHub Desktop.
BaaS Linux Firewall

BaaS Linux Firewall

/etc/sysctl.conf

net.ipv4.ip_forward=1

/etc/network/interfaces

cntf1

# up link
auto enp4s0f2
iface enp4s0f2 inet manual

iface enp4s0f2 inet static
	address 10.176.8.9
	netmask 255.255.255.248
	gateway 10.176.8.14

# down link
auto em2
auto em2.3891
iface em2.3891 inet static
	address 10.176.63.254
	netmask 255.255.255.0
	vlan-raw-device em2

skc5

# up link
auto enp4s0f2
iface enp4s0f2 inet manual

iface enp4s0f2 inet static
	address 10.184.8.9
	netmask 255.255.255.248
	gateway 10.184.8.14

# down link
auto em2
auto em2.3891
iface em2.3891 inet static
	address 10.180.63.254
	netmask 255.255.255.0
	vlan-raw-device em2

save iptables rules

iptables-save > /etc/iptables/rules.v4

load iptables rules

iptables-restore < /etc/iptables/rules.v4

install vlan package

sudo apt-get install vlan

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment