Initial version of network module.

This commit is contained in:
Timo Mkinen 2009-08-20 00:20:04 +03:00
parent 56ee9b1bd6
commit 02fa10f33c
5 changed files with 407 additions and 0 deletions

View file

@ -0,0 +1,6 @@
<% if proto == 'dhcp' -%>
dhcp NONE NONE NONE<% options.each do |val| -%> <%= val -%><% end -%>
<% else -%>
inet <%= ipaddr -%> <%= netmask -%> NONE<% options.each do |val| -%> <%= val -%><% end -%>
<% end -%>

View file

@ -0,0 +1,3 @@
inet 0.0.0.0 255.255.255.255 NONE pppoedev <%= device -%> authproto <%= authtype -%> authname '<%= username -%>' authkey '<%= password %>' up
dest 0.0.0.1
!/sbin/route add default -ifp pppoe0 0.0.0.1

View file

@ -0,0 +1,23 @@
DEVICE=<%= name %>
<% if name !~ /bond[0-9]/ && has_variable?("macaddress_" + name) -%>
HWADDR=<%= scope.lookupvar("macaddress_" + name) %>
<% end -%>
ONBOOT=yes
BOOTPROTO=<%= proto %>
<% if proto == 'none' -%>
IPV6INIT=no
<% end -%>
<% if ipaddr != 'none' -%>
IPADDR=<%= ipaddr %>
<% end -%>
<% if netmask != 'none' -%>
NETMASK=<%= netmask %>
<% end -%>
<% if proto == 'dhcp' -%>
DHCPCLASS=
PERSISTENT_DHCLIENT=yes
NOZEROCONF=yes
<% end -%>
<% options.each do |val| -%>
<%= val %>
<% end -%>

View file

@ -0,0 +1,14 @@
# Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
# In the simple scenario, you want a single virtual IP address from the _same_
# network to be taken over by one of the routers.
VIP_ADDRESS="<%= ipaddr -%>"
SOURCE_ADDRESS="<%= ipaddress %>"
# In more complex scenarios, check the "vip-common" file for values to override
# and how to add options.
PASSWORD="<%= password -%>"
# Extra options.
OPTIONS="<% options.each do |val| -%> <%= val %><% end -%>"