2010-08-31 17:54:24 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-04-18 11:09:58 +02:00
|
|
|
grep <%= @real_tinc_bridge_interface %> /proc/net/dev | awk -F: '{ print $1 }' | grep -q <%= @real_tinc_bridge_interface %>
|
2010-10-22 23:15:28 +02:00
|
|
|
if [ $? -gt 0 ]; then
|
2014-04-18 11:09:58 +02:00
|
|
|
brctl addbr <%= @real_tinc_bridge_interface %>
|
2014-12-29 14:01:41 +01:00
|
|
|
ip addr delete <%= @real_tinc_internal_ip %>/<%= @real_tinc_internal_netmask %> dev <%= @tinc_internal_interface %>
|
|
|
|
ip addr add <%= @real_tinc_internal_ip %>/<%= @real_tinc_internal_netmask %> dev <%= @real_tinc_bridge_interface %>
|
2014-04-18 11:09:58 +02:00
|
|
|
brctl addif <%= @real_tinc_bridge_interface %> <%= @tinc_internal_interface %>
|
2014-12-28 13:30:11 +01:00
|
|
|
ip link set dev <%= @tinc_internal_interface %> up
|
2010-10-22 23:15:28 +02:00
|
|
|
fi
|
2010-08-31 17:54:24 +02:00
|
|
|
|
2014-04-18 11:09:58 +02:00
|
|
|
brctl addif <%= @real_tinc_bridge_interface %> $INTERFACE
|
2014-12-29 14:22:32 +01:00
|
|
|
ip link set dev <%= @real_tinc_bridge_interface %> up
|
2014-12-28 13:30:11 +01:00
|
|
|
ip link set dev $INTERFACE up
|
2014-04-18 11:09:58 +02:00
|
|
|
<% if @override_mtu -%>
|
2014-12-28 13:30:11 +01:00
|
|
|
ip link set dev $INTERFACE mtu <%= @override_mtu.to_i %>
|
2013-08-10 14:58:21 +02:00
|
|
|
<% end -%>
|