FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
210 views 0 comments
by anonymous
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 anonymous

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