Browse Source

New multicast route setup style

OPENBSD_2_5
niklas 26 years ago
parent
commit
1924512d00
2 changed files with 38 additions and 9 deletions
  1. +30
    -7
      src/etc/netstart
  2. +8
    -2
      src/etc/rc.conf

+ 30
- 7
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: netstart,v 1.47 1999/03/26 14:34:31 niklas Exp $
# $OpenBSD: netstart,v 1.48 1999/03/29 22:09:58 niklas Exp $
# Returns true if $1 contains only alphanumerics # Returns true if $1 contains only alphanumerics
isalphanumeric() { isalphanumeric() {
@ -135,14 +135,37 @@ done
# that name must be in /etc/hosts. # that name must be in /etc/hosts.
if [ -f /etc/mygate ]; then if [ -f /etc/mygate ]; then
route -n add -host default `cat /etc/mygate` route -n add -host default `cat /etc/mygate`
# default multicast route for hosts with a gateway
route -n add -net 224.0.0.0 -interface default
else
# default multicast route
route -n add -net 224.0.0.0 -interface $hostname
fi fi
# Multicast routing.
#
# The routing to the 224.0.0.0/4 net is setup according to these rules:
# multicast_host multicast_router route comment
# NO NO -reject no multicast
# NO YES none installed daemon will run
# YES/interface NO -interface YES=def. iface
# Any other combination -reject config error
case "$multicast_host:$multicast_router" in
NO:NO)
route -n add -net 224.0.0.0/4 -interface 127.0.0.1 -reject;;
NO:YES)
;;
*:NO)
set `if [ $multicast_host = YES ]; then
ed -s '!route -n show' <<EOF
/^default/p
EOF
else
ed -s "!ifconfig $multicast_host" <<EOF
/^ inet /p
EOF
fi`
route -n add -net 224.0.0.0/4 -interface $2;;
*:*)
echo 'config error, multicasting disabled until rc.conf is fixed'
route -n add -net 224.0.0.0/4 -interface 127.0.0.1 -reject;;
esac
# Configure NAT after configuring network interfaces # Configure NAT after configuring network interfaces
if [ "${ipnat}" = "YES" -a "${ipfilter}" = "YES" -a -f "${ipnat_rules}" ]; then if [ "${ipnat}" = "YES" -a "${ipfilter}" = "YES" -a -f "${ipnat_rules}" ]; then
echo 'configuring NAT' echo 'configuring NAT'


+ 8
- 2
src/etc/rc.conf View File

@ -1,10 +1,11 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: rc.conf,v 1.34 1998/12/21 03:33:43 deraadt Exp $
# $OpenBSD: rc.conf,v 1.35 1999/03/29 22:09:58 niklas Exp $
# set these to "NO" to turn them off. otherwise, they're used as flags # set these to "NO" to turn them off. otherwise, they're used as flags
routed_flags=NO # for 'normal' use: routed_flags="-q" routed_flags=NO # for 'normal' use: routed_flags="-q"
mrouted_flags=NO # for 'normal' use: mrouted_flags=""
mrouted_flags=NO # for 'normal' use: mrouted_flags="", if activated
# be sure to enable multicast_router below.
rarpd_flags=NO # for 'normal' use: rarpd_flags="-a" rarpd_flags=NO # for 'normal' use: rarpd_flags="-a"
bootparamd_flags=NO # for 'normal' use: bootparamd_flags="" bootparamd_flags=NO # for 'normal' use: bootparamd_flags=""
rbootd_flags=NO # for 'normal' use: rbootd_flags="" rbootd_flags=NO # for 'normal' use: rbootd_flags=""
@ -44,6 +45,11 @@ sshd=YES # run sshd if it exists
ntpd=YES # run ntpd if it exists ntpd=YES # run ntpd if it exists
afs=NO # mount and run afs afs=NO # mount and run afs
# Multicast routing configuration
# Please look at /etc/netstart for a detailed description if you change these
multicast_host=NO # Route all multicast packets to a single interface
multicast_router=NO # A multicast routing daemon will be run, e.g. mrouted
# miscellaneous other flags # miscellaneous other flags
# only used if the appropriate server is marked YES above # only used if the appropriate server is marked YES above
gated_flags= gated_flags=


Loading…
Cancel
Save