Article 57P8J How do I make "ip link" and "ip addr" changes happen on startup?

How do I make "ip link" and "ip addr" changes happen on startup?

by
sllinux
from LinuxQuestions.org on (#57P8J)
I am running the following commands on Ubuntu to create a VLAN, create a bridge, and reassign an IP address to the bridge. It all works, but the changes are lost when I restart the system.

What's the best way to make these changes permanent across reboots? Note that the tap0 interface is created by OpenVPN on startup, so these changes need to happen after the tap0 interface has been created.

Code:sudo ip link add link eth1 name eth1.1 type vlan id 1
sudo ip link set up eth1.1
sudo ip link add br0 type bridge
sudo ip link set up br0
sudo ip link set tap0 master br0
sudo ip link set eth1.1 master br0
sudo ip addr del 10.8.1.2/16 dev tap0
sudo ip addr add 10.8.1.2/16 dev br0latest?d=yIl2AUoC8zA latest?i=q6WEJ2rgIkQ:LK8A7okK8sw:F7zBnMy latest?i=q6WEJ2rgIkQ:LK8A7okK8sw:V_sGLiP latest?d=qj6IDK7rITs latest?i=q6WEJ2rgIkQ:LK8A7okK8sw:gIN9vFwq6WEJ2rgIkQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments