-Ignore the 169.254 network
-Set ntp server and log server to self for now git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1003 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
0a99872096
commit
c13a1c876b
@ -279,6 +279,9 @@ sub process_request {
|
||||
if ($querynics) { #Use netstat to determine activenics only when no site ent.
|
||||
foreach (@nrn) {
|
||||
my @ent = split /\s+/;
|
||||
if ($ent[0] eq "169.254.0.0") {
|
||||
next;
|
||||
}
|
||||
if ($ent[7] =~ m/(ipoib|ib|vlan|bond|eth|myri|man|wlan)/) { #Mask out many types of interfaces, like xCAT 1.x
|
||||
$activenics{$ent[7]} = 1;
|
||||
}
|
||||
@ -341,6 +344,9 @@ sub process_request {
|
||||
}
|
||||
foreach (@nrn) {
|
||||
my @line = split /\s+/;
|
||||
if ($ent[0] eq "169.254.0.0") {
|
||||
next;
|
||||
}
|
||||
if ($activenics{$line[7]} and $line[3] !~ /G/) {
|
||||
addnet($line[0],$line[2]);
|
||||
}
|
||||
@ -355,6 +361,9 @@ sub addnet {
|
||||
unless (grep /\} # $net\/$mask subnet_end/,@dhcpconf) {
|
||||
foreach (@nrn) { # search for relevant NIC
|
||||
my @ent = split /\s+/;
|
||||
if ($ent[0] eq "169.254.0.0") {
|
||||
next;
|
||||
}
|
||||
if ($ent[0] eq $net and $ent[2] eq $mask) {
|
||||
$nic=$ent[7];
|
||||
}
|
||||
@ -376,6 +385,8 @@ sub addnet {
|
||||
my $gateway;
|
||||
my $tftp;
|
||||
my $range;
|
||||
my $myip;
|
||||
$myip = xCAT::Utils->my_ip_facing($net);
|
||||
if ($nettab) {
|
||||
my ($ent) = $nettab->getAttribs({net=>$net,mask=>$mask},qw(tftpserver nameservers gateway dynamicrange dhcpserver));
|
||||
if ($ent and $ent->{nameservers}) {
|
||||
@ -386,7 +397,7 @@ sub addnet {
|
||||
if ($ent and $ent->{tftpserver}) {
|
||||
$tftp = $ent->{tftpserver};
|
||||
} else { #presume myself to be it, dhcp no longer does this for us
|
||||
$tftp = xCAT::Utils->my_ip_facing($net);
|
||||
$tftp = $myip;
|
||||
}
|
||||
if ($ent and $ent->{gateway}) {
|
||||
$gateway = $ent->{gateway};
|
||||
@ -424,6 +435,8 @@ sub addnet {
|
||||
if ($tftp) {
|
||||
push @netent," next-server $tftp;\n";
|
||||
}
|
||||
push @netent," option log-servers $myip;\n";
|
||||
push @netent," option ntp-servers $myip;\n";
|
||||
push @netent," option domain-name \"$domain\";\n";
|
||||
if ($nameservers) {
|
||||
push @netent," option domain-name-servers $nameservers;\n";
|
||||
|
@ -75,6 +75,9 @@ sub process_request {
|
||||
my $mgtifname;
|
||||
my $gw;
|
||||
my @ent = split /\s+/,$_;
|
||||
if ($ent[0] eq "169.254.0.0") {
|
||||
next;
|
||||
}
|
||||
if ($ent[3] eq 'U') {
|
||||
$net = $ent[0];
|
||||
$mask = $ent[2];
|
||||
|
Loading…
Reference in New Issue
Block a user