Last active
February 20, 2019 17:17
-
-
Save garronej/ff2c5444d00251315125f436beed65ce to your computer and use it in GitHub Desktop.
Setup EC2 instance with two network interfaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> See comments | |
src: https://unix.stackexchange.com/questions/4420/reply-on-same-interface-as-incoming | |
Detailed infos: http://irp.nain-t.net/doku.php/100iproute:020_iproute2 |
For deploy semasim !
On instances:
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet dhcp
#172.31.21.X - access only via VPN
#Add route to the VPN gateway
up ip route add 10.8.0.0/24 via 172.31.19.1 dev eth0
iface eth1 inet dhcp
#172.31.20.X - interface dedicated to running semasim instances
#This interface cannot access internet.
# We route all trafic originated from this interface to the
# load balancer except for local trafic that we route normaly.
# [/etc/iproute2/rt_ables ] 200 t_eth1
up ip rule add from 172.31.20.0/24 table t_eth1
up ip route add default via 172.31.19.1 dev eth1 table t_eth1
up ip route add 172.31.16.0/20 dev eth1 proto kernel scope link table t_eth1
iface eth2 inet dhcp
iface eth3 inet dhcp
iface eth4 inet dhcp
iface eth5 inet dhcp
iface eth6 inet dhcp
iface eth7 inet dhcp
/etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
#
200 t_eth1
Pour savoir dans quelle ordre sont évaluer les tables on fait ip rule list
le nombre gauche représente la prio, évaluer dans l'ordre croissant.
Pour changer la priorité d'une table quand on fait ip rule add from ... table .... prio XXXX
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Deploy semasim :
On load balancer:
/etc/network/interfaces
/etc/iproute2/rt_tables