Added extra ASN-range comments, added Priv eBGP on host details, changed color to light-blue instead of red (#15372)

This commit is contained in:
Tim de Boer
2023-10-04 17:07:14 +02:00
committed by GitHub
parent 27be56ecf1
commit 15fd452b8a
4 changed files with 19 additions and 3 deletions

View File

@@ -154,6 +154,12 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql
$peer_type = "<span style='color: #00f;'>iBGP</span>";
} else {
$peer_type = "<span style='color: #0a0;'>eBGP</span>";
// Private ASN ranges
// 64512 - 65534 (Private)
// 4200000000 - 4294967294 (Private)
if (($peer['bgpPeerRemoteAs'] >= 64512 && $peer['bgpPeerRemoteAs'] <= 65534) || ($peer['bgpPeerRemoteAs'] >= 4200000000 && $peer['bgpPeerRemoteAs'] <= 4294967294)) {
$peer_type = "<span style='color: #0af;'>Priv eBGP</span>";
}
}
$query = 'SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE ';

View File

@@ -249,8 +249,11 @@ if (! Auth::user()->hasGlobalRead()) {
$peer_type = "<span style='color: #00f;'>iBGP</span>";
} else {
$peer_type = "<span style='color: #0a0;'>eBGP</span>";
// Private ASN ranges
// 64512 - 65534 (Private)
// 4200000000 - 4294967294 (Private)
if (($peer['bgpPeerRemoteAs'] >= 64512 && $peer['bgpPeerRemoteAs'] <= 65534) || ($peer['bgpPeerRemoteAs'] >= 4200000000 && $peer['bgpPeerRemoteAs'] <= 4294967294)) {
$peer_type = "<span style='color: #f00;'>Priv eBGP</span>";
$peer_type = "<span style='color: #0af;'>Priv eBGP</span>";
}
}