s6-netdev/generic.sh

26 lines
631 B
Bash
Executable File

#!/bin/sh
. "$(dirname -- "$0")/netdev.sh"
# Handle loopback specially
# - addresses are assigned automatically when brought up
# - interface is created automatically by the kernel
IFACE="lo"
new_if_phys "$IFACE"
#if_ip_addr "$IFACE" '127.0.0.1/8'
#if_ip_addr "$IFACE" '::1/128'
BRIDGE="br0"
new_if_bridge "$BRIDGE"
if_bridge_property 'mcast_router' "$BRIDGE"
if_bridge_property 'mcast_snooping' "$BRIDGE" '0' ''
if_bridge_property 'mcast_querier' "$BRIDGE"
if_bridge_property 'mcast_mld_version' "$BRIDGE" '2' ''
if_dhcp "$BRIDGE"
if_dhcpv6 "$BRIDGE"
IFACE="eth0"
if_slave "$BRIDGE" "$IFACE"
new_if_phys "$IFACE"