Use dummy100 instead of lo:100 on Linux

Dummies are better than loopbacks for routing packets to/from.
This commit is contained in:
George Kargiotakis 2017-04-17 01:21:36 +03:00
parent 9a8f3d9dd0
commit ed2e42964f
3 changed files with 22 additions and 12 deletions

View file

@ -7,12 +7,18 @@
- name: flush routing cache - name: flush routing cache
shell: echo 1 > /proc/sys/net/ipv4/route/flush shell: echo 1 > /proc/sys/net/ipv4/route/flush
- name: restart loopback
shell: ifdown lo:100 && ifup lo:100
- name: restart loopback bsd - name: restart loopback bsd
shell: > shell: >
ifconfig lo100 destroy || true && ifconfig lo100 destroy || true &&
ifconfig lo100 create && ifconfig lo100 create &&
ifconfig lo100 inet {{ local_service_ip }} netmask 255.255.255.255 && ifconfig lo100 inet {{ local_service_ip }} netmask 255.255.255.255 &&
ifconfig lo100 inet6 FCAA::1/64; echo $? ifconfig lo100 inet6 FCAA::1/64; echo $?
- name: load dummy
shell: modprobe dummy
- name: add dummy
shell: ip link add dummy100 type dummy
- name: restart dummy
shell: ifdown --force dummy100 && ifup dummy100

View file

@ -44,17 +44,21 @@
tags: tags:
- cloud - cloud
- name: Loopback for services configured - name: Dummy interface for services configured
template: src=10-loopback-services.cfg.j2 dest=/etc/network/interfaces.d/10-loopback-services.cfg template: src=10-dummy-services.cfg.j2 dest=/etc/network/interfaces.d/10-dummy-services.cfg
notify: notify:
- restart loopback - load dummy
- add dummy
- restart dummy
tags: tags:
- always - always
- name: Loopback included into the network config - name: Dummy interface included into the network config
lineinfile: dest=/etc/network/interfaces line='source /etc/network/interfaces.d/10-loopback-services.cfg' state=present lineinfile: dest=/etc/network/interfaces line='source /etc/network/interfaces.d/10-dummy-services.cfg' state=present
notify: notify:
- restart loopback - load dummy
- add dummy
- restart dummy
tags: tags:
- always - always

View file

@ -1,9 +1,9 @@
auto lo:100 auto dummy100
iface lo:100 inet static iface dummy100 inet static
address {{ local_service_ip }} address {{ local_service_ip }}
netmask 255.255.255.255 netmask 255.255.255.255
iface lo:100 inet6 static iface dummy100 inet6 static
address FCAA::1 address FCAA::1
netmask 64 netmask 64
autoconf 0 autoconf 0