local ip="${net%.*}.${IPNUM}/${ip_bits#*/}"
+ local ipv6="fc00:${net//./:}::${IPNUM}/64"
+
# This can be used to override the variables in the echo
# statement below. The hook can use any other variables
# available in this function.
run_hooks hack_network_map_hooks
- echo "${netname} ${dev} ${ip} ${mac} ${opts}"
+ echo "${netname} ${dev} ${ip} ${ipv6} ${mac} ${opts}"
count=$(($count + 1))
done >"$network_map"
}
# specified then use the IP address associated with it.
INSTALL_IP=""
INSTALL_GW=""
- local netname dev ip mac opts
- while read netname dev ip mac opts; do
+ local netname dev ip ipv6 mac opts
+ while read netname dev ip ipv6 mac opts; do
local o
for o in $opts ; do
case "$o" in
diskimage rm_rf "/etc/udev/rules.d/70-persistent-net.rules"
echo "Setting up network interfaces: "
- local netname dev ip mac opts
- while read netname dev ip mac opts; do
+ local netname dev ip ipv6 mac opts
+ while read netname dev ip ipv6 mac opts; do
echo " $dev"
local o gw addr mask
IPADDR=$addr
NETMASK=$mask
HWADDR=$mac
+IPV6INIT=yes
+IPV6ADDR=$ipv6
${gw:+GATEWAY=}${gw}
EOF
defconf NETWORKS "10.0.0.0/24,eth0,gw=10.0.0.1 10.0.1.0/24,eth1 10.0.2.0/24,eth2" \
"<list>" "description of IP networks"
+defconf NETWORK_STACK "ipv4" \
+ "ipv4|dual|ipv6" "Configure IPv4/IPv6 stacks"
+
make_public_addresses()
{
local firstip="${1:-$[${FIRSTIP} + ${PUBLIC_IP_OFFSET}]}"
network_template ()
{
- local netname dev ip mac opts
- while read netname dev ip mac opts ; do
+ local netname dev ip ipv6 mac opts
+ while read netname dev ip ipv6 mac opts ; do
cat <<EOF
<interface type='network'>
<mac address='${mac}'/>
{
local netname="$1"
local ip="$2"
- local opts="$3"
+ local ipv6="$3"
+ local opts="$4"
local uuid=$(uuidgen)
ip_addr=${ip%/*}
ip_mask=${ip#*/}
+ ipv6_addr=${ipv6%/*}
+ ipv6_mask=${ipv6#*/}
+
cat <<EOF
<bridge name='${netname}' stp='on' forwardDelay='0' />
<ip address='${ip_addr}' prefix='${ip_mask}' />
+ <ip family='ipv6' address='${ipv6_addr}' prefix='${ipv6_mask}' />
</network>
EOF
}
fi
-while read netname dev ip mac opts ; do
+while read netname dev ip ipv6 mac opts ; do
echo "Setting up network \"${netname}\""
t=$(mktemp)
- gen_xml "$netname" "$ip" "$opts" >"$t"
+ gen_xml "$netname" "$ip" "$ipv6" "$opts" >"$t"
if $dry_run ; then
cat "$t"
else