11384 questions

13559 answers


31871 members

0 votes
132 views 0 comments
Hi All:

I would like these two commands to execute on startup:

ip tuntap add name tap0 mode tap

ip addr add brd + dev tap0

The "should" be placed into the /etc/config/network file somehow but am unsure of the syntax.

Can someone point me the way?



1 Answer

0 votes


In this case, I would say, you would need a script that would run automatically on startup.

To execute scripts or commands on startup you can put them in /etc/rc.local file.

To not bother editing current config files through commands and how to not mess up what's inside - I would suggest just swapping the current configuration with the new one, that you would store somewhere in the memory of your device.

rm <currentfileLocation> removes the file from the location

cp <newconfig> <destination> copies your new config to the destination where the old config was located.

/etc/init.d/network restart to restart network service and load the new config.

And above is all if you want to place something into your /etc/config/network. But if you want to just execute these commands like in CLI, then just put them into rc.local file and it should be fine.


Best answer