hello i would like to execute this lines :
ifconfig eth0 192.168.8.1
ifconfig usb0 192.168.7.3
systemctl stop firewalld.service
sudo iptables -t nat -A POSTROUTING --out-interface usb0 -j MASQUERADE
sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
sleep 1
echo 1 > /proc/sys/net/ipv4/ip_forward
at the end of load of linux, I know that i have to do something in init.d but I'm not realy sure what ...
I copied example script to /etc/init.d
cat example
#!/bin/sh
# Example script
# Copyright (C) 2007 OpenWrt.org
START=10
STOP=15
boot() {
echo boot
ifconfig eth0 192.168.8.1
ifconfig usb0 192.168.7.3
systemctl stop firewalld.service
sudo iptables -t nat -A POSTROUTING --out-interface usb0 -j MASQUERADE
sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
sleep 1
echo 1 > /proc/sys/net/ipv4/ip_forward
# commands to run on boot
}
start() {
echo start
# commands to launch application
}
stop() {
echo stop
# commands to kill application
}
/etc/init.d directory output
:/etc/init.d# ls
acpid halt mountnfs.sh single
alsa-utils hdparm mtab.sh skeleton
apache2 hostapd networking ssh
avahi-daemon hostname.sh pppd-dns sudo
bluetooth hwclock.sh procps udev
bootlogs kbd rc udev-mtab
bootmisc.sh keyboard-setup rc.local udhcpd
capemgr.sh killprocs rcS umountfs
checkfs.sh kmod README umountnfs.sh
checkroot-bootclean.sh lightdm reboot umountroot
checkroot.sh loadcpufreq rmnologin urandom
console-setup motd rsync wicd
cpufrequtils mountall-bootclean.sh rsyslog x11-common
cron mountall.sh samba xrdp
dbus mountdevsubfs.sh saned
example mountkernfs.sh screen-cleanup
generic-boot-script.sh mountnfs-bootclean.sh sendsigs
I also enabled this script but its not working. Can someone help me please ??