#!/bin/sh # # Copyright IBM, Corp. 2010 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory.
# Set to the name of your bridge BRIDGE=br0
# Network information NETWORK=192.168.53.0 NETMASK=255.255.255.0 GATEWAY=192.168.53.1 DHCPRANGE=192.168.53.2,192.168.53.254
# Optionally parameters to enable PXE support TFTPROOT= BOOTP=
do_brctl() { brctl "$@" }
do_ifconfig() { ifconfig "$@" }
do_dd() { dd"$@" }
do_iptables_restore() { iptables-restore "$@" }
do_dnsmasq() { dnsmasq "$@" }
check_bridge() { if do_brctl show | grep "^$1" > /dev/null 2> /dev/null; then return 1 else return 0 fi }
create_bridge() { do_brctl addbr "$1" do_brctl stp "$1" off do_brctl setfd "$1" 0 do_ifconfig "$1""$GATEWAY" netmask "$NETMASK" up }
#!/bin/sh # # Copyright IBM, Corp. 2010 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory.
# Set to the name of your bridge BRIDGE=br0
# Network information NETWORK=192.168.53.0 NETMASK=255.255.255.0 GATEWAY=192.168.53.1 DHCPRANGE=192.168.53.2,192.168.53.254
# Optionally parameters to enable PXE support TFTPROOT= BOOTP=
do_brctl() { brctl "$@" }
do_ifconfig() { ifconfig "$@" }
do_dd() { dd"$@" }
do_iptables_restore() { iptables-restore "$@" }
do_dnsmasq() { dnsmasq "$@" }
check_bridge() { if do_brctl show | grep "^$1" > /dev/null 2> /dev/null; then return 1 else return 0 fi }
create_bridge() { do_brctl addbr "$1" do_brctl stp "$1" off do_brctl setfd "$1" 0 do_ifconfig "$1""$GATEWAY" netmask "$NETMASK" up }