10948 questions

13055 answers

20356 comments

27897 members

0 votes
122 views 0 comments
by
Hi All:

I would like these two commands to execute on startup:

ip tuntap add name tap0 mode tap

ip addr add 2.2.2.89/32 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?

Cheers,

john

1 Answer

0 votes
by

Hi,

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.

EB.

Best answer