From 3ed32b437d4daacf83f723ca2b30e6f46ef26400 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 23 Oct 2012 09:18:41 +0000 Subject: [PATCH] enable ipforwarding for IPv6 and IPv4 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14095 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 5c28d4528..26ecca1ba 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -517,6 +517,32 @@ if ($::INITIALINSTALL || $::FORCE) } } + # Enable ip forwarding. In most cases, + # the MN itself will act as the default gateway for the compute nodes, + # ip forwarding is required for a network gateway + xCAT::NetworkUtils->setup_ip_forwarding(1); + + # Enable ipv6 forwarding, + # only if there are IPv6 networks in the networks table + my $ipv6net = 0; + my $ntab = xCAT::Table->new('networks'); + if ($ntab) + { + foreach my $enet (@{$ntab->getAllEntries()}) + { + if ($enet->{'net'} =~ /:/) + { + $ipv6net = 1; + } + } + $ntab->close(); + } + if ($ipv6net) + { + xCAT::NetworkUtils->setup_ipv6_forwarding(1); + } + + my $linux_note = "xCAT is now running, it is recommended to tabedit networks \nand set a dynamic ip address range on any networks where nodes \nare to be discovered. Then, run makedhcp -n to create a new dhcpd \nconfiguration file, and \/etc\/init.d\/dhcpd restart. Either examine sample \nconfiguration templates, or write your own, or specify a value per \nnode with nodeadd or tabedit."; xCAT::MsgUtils->message('I', $linux_note);