Skip to content

Instantly share code, notes, and snippets.

@manuke
Last active June 4, 2020 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuke/eb19a372f399ad4d961c2b8b36bf13c0 to your computer and use it in GitHub Desktop.
Save manuke/eb19a372f399ad4d961c2b8b36bf13c0 to your computer and use it in GitHub Desktop.
amazonlinux2
linux 同一セグメント 複数ipの来たインターフェイスのIPから戻り設定
https://engineering.silk.co/post/31923247961/multiple-ip-addresses-on-amazon-ec2
https://qiita.com/fururun02/items/69d1ddac298b4ce48269
```
# tempraly
bash -c "echo '2 eth0_rt' >> /etc/iproute2/rt_tables"
ip rule add from 172.31.0.22 table eth0_rt
ip route add default via 172.31.0.1 dev eth0 table eth0_rt
ip route show table eth0_rt
ip rule show
ip route flush cache
# permanent
bash -c "echo '2 eth0_rt' >> /etc/iproute2/rt_tables"
echo "from 172.31.0.22 table eth0_rt" >>/etc/sysconfig/network-scripts/rule-eth0
echo "default via 172.31.0.1 dev eth0 table eth0_rt" >>/etc/sysconfig/network-scripts/route-eth0
```
SSM roleをEC2に割り当てる(デフォルトだとS3全許可なので手動で絞るか?)
http://www.daemonology.net/blog/2016-10-09-EC2s-most-dangerous-feature.html
amazon-linux-extras install ansible2
##docker latest amazon linux2 container
amazon-linux-extras install docker
systemctl start docker
docker pull amazonlinux
docker run -d -p 8888:80 amazonlinux
curl -O 'https://raw.githubusercontent.com/aws/amazon-linux-docker-images/d59369b8dc1f3a41231d550274a565a349fb326b/Dockerfile'
docker build -t amazonlinux2 .
timedatectl set-timezone Asia/Tokyo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment