summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2001-09-19 21:27:27 +0000
committerbrooks <brooks@FreeBSD.org>2001-09-19 21:27:27 +0000
commitdcf7dde14532f48c9adcdcea0805c4c998e25902 (patch)
tree1f57d5b3e387ce14a1f6e49b1a1f8efe697d0b60
parentb0e7279ba20f9919fc823af5abb36352b0220380 (diff)
downloadFreeBSD-src-dcf7dde14532f48c9adcdcea0805c4c998e25902.zip
FreeBSD-src-dcf7dde14532f48c9adcdcea0805c4c998e25902.tar.gz
Add a new rc.conf variable, cloned_interfaces, to create cloned
interfaces at boot.
-rw-r--r--etc/defaults/rc.conf2
-rw-r--r--etc/network.subr11
-rw-r--r--etc/rc.d/netoptions11
-rw-r--r--etc/rc.d/network111
-rw-r--r--etc/rc.d/network211
-rw-r--r--etc/rc.d/network311
-rw-r--r--etc/rc.d/routing11
-rw-r--r--etc/rc.network11
-rw-r--r--share/man/man5/rc.conf.58
9 files changed, 80 insertions, 7 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 5310643..f703c8e 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -86,6 +86,8 @@ tcp_drop_synfin="NO" # Set to YES to drop TCP packets with SYN+FIN
icmp_drop_redirect="NO" # Set to YES to ignore ICMP REDIRECT packets
icmp_log_redirect="NO" # Set to YES to log ICMP REDIRECT packets
network_interfaces="auto" # List of network interfaces (or "auto").
+cloned_interfaces="" # List of cloned network interfaces to create.
+#cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config.
ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
#ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry.
diff --git a/etc/network.subr b/etc/network.subr
index 2bf0b58..b715539 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 2bf0b58..b715539 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.d/network1 b/etc/rc.d/network1
index 2bf0b58..b715539 100644
--- a/etc/rc.d/network1
+++ b/etc/rc.d/network1
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.d/network2 b/etc/rc.d/network2
index 2bf0b58..b715539 100644
--- a/etc/rc.d/network2
+++ b/etc/rc.d/network2
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3
index 2bf0b58..b715539 100644
--- a/etc/rc.d/network3
+++ b/etc/rc.d/network3
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 2bf0b58..b715539 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/etc/rc.network b/etc/rc.network
index 2bf0b58..b715539 100644
--- a/etc/rc.network
+++ b/etc/rc.network
@@ -127,6 +127,11 @@ network_pass1() {
;;
esac
+ # Attempt to create cloned interfaces.
+ for ifn in ${cloned_interfaces}; do
+ ifconfig ${ifn} create
+ done
+
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig section, since in the case
# of hardwired (no link1 flag) but required authentication, you
@@ -151,6 +156,9 @@ network_pass1() {
[Aa][Uu][Tt][Oo])
network_interfaces="`ifconfig -l`"
;;
+ *)
+ network_interfaces="${network_interfaces} ${cloned_interfaces}"
+ ;;
esac
dhcp_interfaces=""
@@ -795,7 +803,8 @@ network_gif_setup() {
continue
;;
*)
- ifconfig $i create tunnel ${peers}
+ ifconfig $i create >/dev/null 2>&1
+ ifconfig $i tunnel ${peers}
;;
esac
done
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index e34f12a..c813ae6 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -608,6 +608,14 @@ it is possible to use something like:
.Bd -literal
ifconfig_ed0="DHCP"
.Ed
+.It Va cloned_interfaces
+.Pq Vt str
+Set to the list of clonable network interfaces to create on this host.
+Entries in
+.Va cloned_interfaces
+are automaticly appended to
+.Va network_interfaces
+for configuration.
.It Va ppp_enable
.Pq Vt bool
If set to
OpenPOWER on IntegriCloud