Commit aac97d1b authored by David Johnson's avatar David Johnson

Tweaks to default layer2 HP switch config.

Set snmp community appropriately.  Turn on spanning tree.

Also make sure that VLAN 1 hasn't gotten a control net addr via DHCP.
When we remove the current switch config and the switch reverts to
its default, it turns on DHCP for VLAN 1.  Then, if it manages to get
a control net address (i.e., from the new node pool), we have to make
sure to unset any IP address in VLAN 1 before assigning one in VLAN 999
(the control net VLAN we use in this static configuration).  Otherwise we
might end up trying to configure an IP addr in the same subnet on two
different VLANs, which the switch won't allow.
parent fa2a2c45
......@@ -1341,6 +1341,14 @@ sub generateConfig($$) {
};
my @cnetlines = ();
#
# We *HAVE* to remove anything that might have snuck into vlan 1
# in the control net subnet, before trying to assign one in vlan 999.
# This seems to sometimes happen via DHCP...
#
push @cnetlines, "vlan 1";
push @cnetlines, " no ip address";
push @cnetlines, "exit";
if (defined($cnetport) && $cnetport ne '') {
push @cnetlines, "vlan 999";
push @cnetlines, " name \"EmulabControlPort\"";
......@@ -1374,6 +1382,25 @@ sub generateConfig($$) {
}
}
my $community = "private";
my $qres = DBQueryFatal("select sst.snmp_community" .
" from switch_stacks as ss" .
" left join switch_stack_types as sst" .
" on ss.stack_id=sst.stack_id" .
" where ss.node_id='$node_id'");
if (defined($qres) && $qres->numrows()) {
my @row = $qres->fetchrow_array();
if (!defined($row[0])) {
tbwarn "Could not find snmp_community for experiment switch $node_id, using default of '$community'!\n";
}
else {
$community = $row[0];
}
}
else {
tbwarn "Could not find snmp_community for experiment switch $node_id!\n";
}
my @config = (
"hostname \"" . $node_id . "\"",
@cnetlines,
......@@ -1383,6 +1410,10 @@ sub generateConfig($$) {
"aaa authentication ssh login local",
@keylines,
@passwdlines,
'snmp-server community "' . $community . '" Unrestricted',
'snmp-server contact "testbed-ops@flux.utah.edu"',
# try to cover our hind ends and eliminate loops!
"spanning-tree",
"no web-management",
"no telnet-server",
"tftp client",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment