|
|
@ -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")
|
|
|
|