Sha256: 1e7d4924334f975b2f3cbd5e7da3ce0890fd798a66a918dff064e0b890a6719e
Contents?: true
Size: 1.17 KB
Versions: 6
Compression:
Stored size: 1.17 KB
Contents
#!/bin/sh -e # Provision routes on Vagrant controled interfaces. # # We can't do this in `/etc/networks/interfaces` because Vagrant doesn't support # adding arbritrary commands to its generated interfaces. This sucks, because it # means we have to hardcode the device names and the user has to guess them from # the order of the network definitions. The alternative to this is to run the ip # commands on every boot, which is arguably even worse. # # TODO found out `private_network` takes an `auto_config => false` which allows # doing the `/etc/networks/interfaces` entry ourselves. # # TODO Send a patch to Vagrant core allowing specifying arbritrary network # interface parameters to the definitions. An example syntax could be: # # config.vm.network :private_network, ip: "...", netmask: "...", # interface: { up: "ip route add .. via .." } # # `iptool` commands don't need to specify the interface when they're part of of # the network hooks in the interface. if [ "$MODE" != start ]; then exit 0 fi if [ "$IFACE" != eth1 ]; then exit 0 fi <% routes.each do |route| %> ip route add <%= route.to_cidr %> via <%= gateway.ip_in_same_subnet(self) %> dev eth1 || true <% end %> exit 0
Version data entries
6 entries across 6 versions & 1 rubygems