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

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

Loading…
Cancel
Save