aboutsummaryrefslogtreecommitdiff
path: root/conf.d
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-16 23:47:23 +0000
committerRoy Marples <roy@marples.name>2009-04-16 23:47:23 +0000
commit6027b0ed7d1791a363004ec5b77ec7e866fc8bc9 (patch)
treef4d8a33beb871f2f90a16de1ec742cd96bcb2232 /conf.d
parent95d954e7b58e55534f393a1249db2becf74ee9f9 (diff)
Add a new init script - network
This simply assigns static addresses and an optional default route. It's possible to add external commands as well, so to create a bonded interface. Hopefully we can add a few examples to satisfy most of the old net.lo, which is no longer installed into boot by default.
Diffstat (limited to 'conf.d')
-rw-r--r--conf.d/Makefile4
-rw-r--r--conf.d/Makefile.FreeBSD3
-rw-r--r--conf.d/Makefile.Linux4
-rw-r--r--conf.d/Makefile.NetBSD3
-rw-r--r--conf.d/network.Linux10
-rw-r--r--conf.d/network.in10
6 files changed, 33 insertions, 1 deletions
diff --git a/conf.d/Makefile b/conf.d/Makefile
index 5040ba27..9d0fc0d0 100644
--- a/conf.d/Makefile
+++ b/conf.d/Makefile
@@ -1,5 +1,7 @@
DIR= ${CONFDIR}
-CONF= bootmisc fsck hostname local localmount net urandom
+CONF= bootmisc fsck hostname local localmount network urandom
+
+CLEANFILES+= network
MK= ../mk
include ${MK}/os.mk
diff --git a/conf.d/Makefile.FreeBSD b/conf.d/Makefile.FreeBSD
index c43a1d4f..fb531e2f 100644
--- a/conf.d/Makefile.FreeBSD
+++ b/conf.d/Makefile.FreeBSD
@@ -1 +1,4 @@
CONF+= ipfw moused powerd rarpd savecore syscons
+
+network:
+ cp network.in network
diff --git a/conf.d/Makefile.Linux b/conf.d/Makefile.Linux
index 74679400..9e1ce9d8 100644
--- a/conf.d/Makefile.Linux
+++ b/conf.d/Makefile.Linux
@@ -1 +1,5 @@
CONF+= consolefont dmesg hwclock keymaps modules
+
+network:
+ cp network.in network
+ cat network.Linux >> network
diff --git a/conf.d/Makefile.NetBSD b/conf.d/Makefile.NetBSD
index 18a52cce..fd0be1ec 100644
--- a/conf.d/Makefile.NetBSD
+++ b/conf.d/Makefile.NetBSD
@@ -1 +1,4 @@
CONF+= moused rarpd savecore
+
+network:
+ cp network.in network
diff --git a/conf.d/network.Linux b/conf.d/network.Linux
new file mode 100644
index 00000000..9967301d
--- /dev/null
+++ b/conf.d/network.Linux
@@ -0,0 +1,10 @@
+# ifconfig under Linux is not that powerful and doesn't easily handle
+# multiple addresses
+# On the other hand, ip (iproute2) is quite powerful and is also supported
+# ip_eth0="192.168.0.10/24; 192.168.10.10/24"
+
+# Create a bonded interface
+# interfaces="bond0"
+# ifup_bond0="modprobe bonding; ifconfig bond0 up; ifenslave bond0 bge0"
+# ifconfig_bond0="192.168.0.10/24"
+# ifdown_bond0="rmmod bonding"
diff --git a/conf.d/network.in b/conf.d/network.in
new file mode 100644
index 00000000..2bb2b071
--- /dev/null
+++ b/conf.d/network.in
@@ -0,0 +1,10 @@
+# Assign static IP addresses and run custom scripts per interface
+# Seperate commands with ;
+# Prefix with ! to run a shell script
+# ifconfig_eth0="up; 192.168.0.10 netmask 255.255.255.0; ! echo up"
+
+# You also have ifup_eth0 and ifdown_eth0 to run other commands when
+# eth0 is started and stopped.
+# Lastly, the interfaces variable pulls in virtual interfaces that cannot
+# be automatically detected.
+