Skip to content

Instantly share code, notes, and snippets.

@hayleyxyz
Created September 6, 2015 21:18
Show Gist options
  • Save hayleyxyz/78f8ac13877ba7a6f4f3 to your computer and use it in GitHub Desktop.
Save hayleyxyz/78f8ac13877ba7a6f4f3 to your computer and use it in GitHub Desktop.
AWS max IPs
$ bash -c "echo '2 eth1_rt' >> /etc/iproute2/rt_tables"
$ cat /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
auto eth0:1
iface eth0:1 inet static
address 172.31.22.83
auto eth1
iface eth1 inet dhcp
address 172.31.27.79
netmask 255.255.255.0
network 172.31.0.0
broadcast 172.31.255.255
up ip route add default via 172.31.16.1 dev eth1 table eth1_rt
up ip rule add from 172.31.27.79/32 lookup eth1_rt prio 1000
auto eth1:1
iface eth1:1 inet static
address 172.31.22.116
netmask 255.255.255.0
network 172.31.0.0
broadcast 172.31.255.255
up ip rule add from 172.31.22.116/32 lookup eth1_rt prio 1000
iface eth2 inet dhcp
iface eth3 inet dhcp
iface eth4 inet dhcp
iface eth5 inet dhcp
iface eth6 inet dhcp
iface eth7 inet dhcp
$ ip route show
default via 172.31.16.1 dev eth0
172.31.0.0/16 dev eth0 proto kernel scope link src 172.31.22.83
172.31.16.0/20 dev eth0 proto kernel scope link src 172.31.31.231
172.31.16.0/20 dev eth1 proto kernel scope link src 172.31.27.79
172.31.22.0/24 dev eth1 proto kernel scope link src 172.31.22.116
$ ip rule show
0: from all lookup local
1000: from 172.31.27.79 lookup eth1_rt
1000: from 172.31.22.116 lookup eth1_rt
32766: from all lookup main
32767: from all lookup default
$ diff tinyproxy.conf /etc/tinyproxy.conf
43c43
< #BindSame yes
---
> BindSame yes
210a211
> Allow 91.121.68.180
$ curl --interface eth1:1 http://icanhazip.com/
52.28.xx.xx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment