{ writeShellScriptBin, iproute2 }: writeShellScriptBin "netali-configure-net-ruby" '' if [[ $# -ne 3 ]]; then echo "Usage: netali-configure-net-ruby [interface] [last-ip-block] [mode]" echo "" echo "interface: name of the network interface to configure" echo "last-ip-block: last block of the IPv6 address of this host" echo "mode: 'public' or 'internal' (affects IP subnet)" exit 1 fi INTERFACE=$1 LAST_IP_BLOCK=$2 MODE=$3 if [[ $MODE == "public" ]]; then PREFIX="2a00:fe0:1:21f::" GATEWAY="2a00:fe0:1:21f::1" else PREFIX="2a00:fe0:3f5:1000::" GATEWAY="2a00:fe0:3f5:1000::1" fi ${iproute2}/bin/ip link set up $INTERFACE ${iproute2}/bin/ip a a $PREFIX$LAST_IP_BLOCK/64 dev $INTERFACE ${iproute2}/bin/ip r a default via $GATEWAY dev $INTERFACE echo "nameserver 2a00:fe0:0:2::300" > /etc/resolv.conf echo "nameserver 2a00:fe0:0:3::300" >> /etc/resolv.conf ''