#!/bin/bash [[ $1 = stop ]] && exit 0 echo rc.inet1 PATH is $PATH echo -n lo ... ifconfig lo up && echo done {% if natgw is defined %} echo -n eth0 ... ifconfig eth0 192.168.122.102/24 up && echo done echo -n eth1 ... ifconfig eth1 10.1.1.{{nodeid}}/24 up && echo done echo -n default route ... route add default gw 192.168.122.1 && echo done # self-verbose sysctl -w net.ipv4.ip_forward=1 echo -n nftables ... nft -f /etc/nftables.conf && echo done {% elif not type.startswith('full') %} echo -n eth0 ... ifconfig eth0 10.1.1.{{nodeid}}/24 up && echo done echo -n default route 10.1.1.2 ... route add default gw 10.1.1.2 && echo done {% elif type.startswith('full') %} echo -n eth0 ... ifconfig eth0 10.1.1.{{nodeid}}/24 up && echo done # this works only with full-dnat echo no default route - dnat only route -n | grep ^0.0.0.0 && route delete default {% else %} {{0/0}} {% endif %}