Merge pull request #6 from telemaco/add-mtu-support

Add MTU support to network devices
pull/15/head
Javi Fontan 10 years ago
commit d36d2cb890

@ -52,6 +52,13 @@ get_mask() {
echo $mask
}
# Gets device MTU
get_mtu() {
mtu=$(get_iface_var "MTU")
echo $mtu
}
is_gateway() {
if [ -z "$GATEWAY_IFACE_NUM" ]; then
true
@ -108,6 +115,10 @@ iface $DEV inet static
netmask $MASK
EOT
if [ -n "$MTU" ]; then
echo " mtu $MTU"
fi
if [ -n "$GATEWAY" ]; then
echo " gateway $GATEWAY"
fi
@ -122,6 +133,10 @@ iface $DEV inet6 static
netmask 64
EOT
if [ -n "$MTU" ]; then
echo " mtu $MTU"
fi
if [ -n "$GATEWAY6" ]; then
echo " gateway $GATEWAY6"
fi
@ -168,6 +183,7 @@ EOT
IP=$(get_ip)
NETWORK=$(get_network)
MASK=$(get_mask)
MTU=$(get_mtu)
GATEWAY=$(get_gateway)
IPV6=$(get_iface_var "IPV6")

@ -52,6 +52,13 @@ get_mask() {
echo $mask
}
# Gets device MTU
get_mtu() {
mtu=$(get_iface_var "MTU")
echo $mtu
}
is_gateway() {
if [ -z "$GATEWAY_IFACE_NUM" ]; then
true
@ -105,6 +112,9 @@ gen_iface_conf() {
NETMASK=$MASK
IPADDR=$IP
EOT
if [ -n "$MTU" ]; then
echo "MTU=$MTU"
fi
if [ -n "$GATEWAY" ]; then
echo "GATEWAY=$GATEWAY"
@ -119,6 +129,10 @@ IPV6INIT=yes
IPV6ADDR=$IPV6
EOT
if [ -n "$MTU" ]; then
echo "MTU=$MTU"
fi
if [ -n "$GATEWAY6" ]; then
echo "IPV6_DEFAULTGW=$GATEWAY6"
fi
@ -159,6 +173,7 @@ gen_network_configuration()
IP=$(get_ip)
NETWORK=$(get_network)
MASK=$(get_mask)
MTU=$(get_mtu)
GATEWAY=$(get_gateway)
IPV6=$(get_iface_var "IPV6")

Loading…
Cancel
Save