BEGIN {FS = " ";print "# This file is generated by RLM upon request from Ontap." ; \
	print "# Do NOT modify this file manually." ; \
#	print "auto lo" ; \
#	print "iface lo inet loopback" ; 
	}

###### dhcp information ######
/^dhcp/ { if ($2 == 1) 		
		print "auto eth0\niface eth0 inet dhcp\nmtu 1400" 
	}

###### ipv4 information ######
/^ip / {if ((dhcp_enabled == 0) && (ipv4_enabled == 1))
	{
		print "auto eth0" ; 
		print "iface eth0 inet static" ; 
        print "   mtu 1400";
		print "   address " $2 
	}
      }
/^netmask/ {if ((dhcp_enabled == 0) && (ipv4_enabled == 1))
	print "   netmask " $2 ;}
/^gateway/ {if ((dhcp_enabled == 0) && (ipv4_enabled == 1))
	print "   gateway " $2 ;}

###### ipv6 information ######
/^ip6_addr/ {if (($2 != "") && (ipv6_enabled == 1))
	{print "iface eth0 inet6 static" ;
    print "   mtu 1400" 
	print "   address " $2 ; }}
/^ip6_prefix/ {if (($2 != "") && (ipv6_enabled == 1) && (ipv6_global_present == 1))
	print "   netmask " $2 ;}
/^ip6_gate/ {if (($2 != "") && (ipv6_enabled == 1) && (ipv6_global_present == 1))
	print "   gateway " $2 ;}

