Update 2023-11-28 22:25 OpenBSD/amd64-x13
This commit is contained in:
parent
c91ec73306
commit
241adee410
35
.bin/obsd-route
Executable file
35
.bin/obsd-route
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ $(id -u) -ne 0 ] && echo "root?" && exit 0
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "obsd-route [start,stop]"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start() {
|
||||||
|
set -x
|
||||||
|
sysctl net.inet.ip.forwarding=1
|
||||||
|
ifconfig trunk0 destroy
|
||||||
|
ifconfig iwx0 inet autoconf
|
||||||
|
ifconfig re0 inet 192.168.23.1 netmask 255.255.255.0
|
||||||
|
rcctl enable dhcpd
|
||||||
|
rcctl set dhcpd flags re0
|
||||||
|
rcctl start dhcpd
|
||||||
|
}
|
||||||
|
|
||||||
|
do_stop() {
|
||||||
|
set -x
|
||||||
|
sysctl net.inet.ip.forwarding=0
|
||||||
|
ifconfig iwx0 -inet
|
||||||
|
ifconfig re0 -inet
|
||||||
|
rcctl stop dhcpd
|
||||||
|
rcctl disable dhcpd
|
||||||
|
sh /etc/netstart
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
start) do_start; ;;
|
||||||
|
stop) do_stop; ;;
|
||||||
|
*) usage;
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user