mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-12-04 10:25:12 +03:00
Top-level routes for CIDR pages
This commit is contained in:
1 parent
9c8efbeac0
commit
51b2a07270
5 files changed
+561
-254
No files matched your search
+459
-61
@@ -1,7 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { site } from '$lib/constants/site';
|
||||
import { SUB_NAV } from '$lib/constants/nav';
|
||||
import { cidrContent } from '$lib/content/cidr';
|
||||
import ToolsGrid from '$lib/components/global/ToolsGrid.svelte';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import type { NavItem, NavGroup } from '$lib/constants/nav';
|
||||
import '../../styles/pages.scss';
|
||||
|
||||
@@ -34,86 +37,481 @@
|
||||
<header class="page-header">
|
||||
<h1>CIDR Tools & Converters</h1>
|
||||
<p class="page-description">
|
||||
Comprehensive CIDR tools for network analysis, conversion, and optimization.
|
||||
Comprehensive CIDR tools for network analysis, conversion, and optimization.
|
||||
Convert between notation formats, summarize networks, split subnets, and perform set operations on IP ranges.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<ToolsGrid tools={cidrTools} />
|
||||
|
||||
<section class="about-cidr explainer-card no-hover">
|
||||
<h2>About CIDR (Classless Inter-Domain Routing)</h2>
|
||||
<p>
|
||||
<strong>CIDR</strong> is a method for allocating IP addresses and routing IP packets more efficiently than the old classful network addressing architecture.
|
||||
CIDR notation uses a slash followed by the number of network bits (e.g., /24) to specify network boundaries.
|
||||
</p>
|
||||
|
||||
<h3>Key Advantages</h3>
|
||||
<ul class="cidr-benefits">
|
||||
<li><strong>Flexible Addressing:</strong> Create networks of any size</li>
|
||||
<li><strong>Route Aggregation:</strong> Combine multiple routes into summaries</li>
|
||||
<li><strong>Efficient Allocation:</strong> Reduce IP address waste</li>
|
||||
<li><strong>Scalable Routing:</strong> Smaller routing tables</li>
|
||||
</ul>
|
||||
<!-- Core Concepts -->
|
||||
<section class="concepts-section">
|
||||
<h2>Essential CIDR Concepts</h2>
|
||||
<div class="concepts-grid">
|
||||
{#each cidrContent.coreConcepts as concept}
|
||||
<div class="concept-card" style="--accent-color: {concept.color}">
|
||||
<div class="concept-header">
|
||||
<Icon name={concept.icon} size="md" />
|
||||
<h3>{concept.title}</h3>
|
||||
</div>
|
||||
<p>{concept.description}</p>
|
||||
<code class="concept-example">{concept.example}</code>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<h3>Common CIDR Blocks</h3>
|
||||
<div class="cidr-examples">
|
||||
<div class="cidr-item">
|
||||
<strong>/24</strong> - 256 addresses (254 hosts)
|
||||
<!-- What is CIDR -->
|
||||
<section class="about-section">
|
||||
<h2>What is CIDR?</h2>
|
||||
<div class="about-grid">
|
||||
<div class="about-content">
|
||||
{#each cidrContent.aboutSection.content as paragraph, i}
|
||||
<p>
|
||||
{#if i === 0}
|
||||
<strong>CIDR (Classless Inter-Domain Routing)</strong> {paragraph.replace('CIDR (Classless Inter-Domain Routing) ', '')}
|
||||
{:else}
|
||||
{paragraph}
|
||||
{/if}
|
||||
</p>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="cidr-item">
|
||||
<strong>/28</strong> - 16 addresses (14 hosts)
|
||||
</div>
|
||||
<div class="cidr-item">
|
||||
<strong>/16</strong> - 65,536 addresses (65,534 hosts)
|
||||
</div>
|
||||
<div class="cidr-item">
|
||||
<strong>/8</strong> - 16,777,216 addresses (16,777,214 hosts)
|
||||
<div class="benefits-list">
|
||||
<h3>Why CIDR Matters</h3>
|
||||
{#each cidrContent.aboutSection.advantages as advantage}
|
||||
<div class="benefit-item">
|
||||
<strong>{advantage.title}:</strong> {advantage.description}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Common CIDR Sizes -->
|
||||
<section class="sizes-section">
|
||||
<h2>Common CIDR Block Sizes</h2>
|
||||
<div class="sizes-table-wrapper">
|
||||
<table class="sizes-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th use:tooltip={"CIDR prefix length notation"}>CIDR</th>
|
||||
<th use:tooltip={"Traditional subnet mask notation"}>Subnet Mask</th>
|
||||
<th use:tooltip={"Number of usable host addresses"}>Hosts</th>
|
||||
<th use:tooltip={"Typical use cases for this network size"}>Common Use</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each cidrContent.commonSizes as size}
|
||||
<tr class="size-row" style="--row-color: {size.color}">
|
||||
<td class="cidr-cell"><strong>{size.cidr}</strong></td>
|
||||
<td class="mask-cell"><code>{size.mask}</code></td>
|
||||
<td class="hosts-cell">{size.hosts}</td>
|
||||
<td class="use-cell">{size.use}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="table-note">
|
||||
<strong>*</strong> /31 networks use special point-to-point addressing (RFC 3021)
|
||||
where both addresses are usable without network/broadcast addresses.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<!-- How CIDR Works -->
|
||||
<section class="how-it-works">
|
||||
<h2>How CIDR Works</h2>
|
||||
<div class="explanation-grid">
|
||||
{#each cidrContent.howItWorks as item}
|
||||
<div class="explanation-item {item.type}">
|
||||
<h3>{item.title}</h3>
|
||||
<p>{item.content}</p>
|
||||
|
||||
{#if item.example.type === 'bit'}
|
||||
<div class="bit-example">
|
||||
<div class="network-bits">{item.example.networkBits}</div>
|
||||
<div class="host-bits">{item.example.hostBits}</div>
|
||||
<div class="labels">
|
||||
<span class="network-label">{item.example.networkLabel}</span>
|
||||
<span class="host-label">{item.example.hostLabel}</span>
|
||||
</div>
|
||||
</div>
|
||||
{:else if item.example.type === 'summary'}
|
||||
<div class="summary-example">
|
||||
<div class="before">
|
||||
<strong>{item.example.before.title}</strong><br>
|
||||
{#each item.example.before.content as line}
|
||||
{line}<br>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="arrow">→</div>
|
||||
<div class="after">
|
||||
<strong>{item.example.after.title}</strong><br>
|
||||
{#each item.example.after.content as line}
|
||||
{line}<br>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{:else if item.example.type === 'tip'}
|
||||
<div class="planning-tip">
|
||||
<strong>{item.example.title}</strong> {item.example.content}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Quick Reference -->
|
||||
<section class="quick-reference">
|
||||
<h2>Quick Reference</h2>
|
||||
<div class="reference-grid">
|
||||
{#each cidrContent.quickReference as card}
|
||||
<div class="reference-card no-hover">
|
||||
<h3>{card.title}</h3>
|
||||
<ul>
|
||||
{#each card.items as item}
|
||||
<li>{item}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.about-cidr {
|
||||
h3 {
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
}
|
||||
.cidr-examples {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
<style lang="scss">
|
||||
/* Core concepts section */
|
||||
.concepts-section {
|
||||
margin: var(--spacing-xl) 0;
|
||||
|
||||
.cidr-benefits {
|
||||
padding-left: 1rem;
|
||||
margin-bottom: var(--spacing-md);
|
||||
list-style: none;
|
||||
li {
|
||||
&::before {
|
||||
content: '•';
|
||||
color: var(--color-primary);
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
margin-left: -1em;
|
||||
.concepts-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
gap: var(--spacing-lg);
|
||||
margin-top: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.concept-card {
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-left: 4px solid var(--accent-color);
|
||||
|
||||
.concept-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
margin-bottom: var(--spacing-md);
|
||||
|
||||
:global(.icon) {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.concept-example {
|
||||
display: block;
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-sm);
|
||||
border-radius: var(--radius-sm);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--accent-color);
|
||||
border: 1px solid color-mix(in srgb, var(--accent-color), transparent 80%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cidr-item {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-secondary);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-primary);
|
||||
text-align: center;
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
/* About section */
|
||||
.about-section {
|
||||
margin: var(--spacing-xl) 0;
|
||||
background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
border: 1px solid var(--border-secondary);
|
||||
|
||||
.about-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: var(--spacing-xl);
|
||||
margin-top: var(--spacing-lg);
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
}
|
||||
|
||||
.about-content p {
|
||||
margin-bottom: var(--spacing-md);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.benefits-list {
|
||||
.benefit-item {
|
||||
background: var(--bg-primary);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-md);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
strong {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cidr-item strong {
|
||||
color: var(--color-primary);
|
||||
font-weight: 600;
|
||||
/* Common sizes table */
|
||||
.sizes-section {
|
||||
margin: var(--spacing-xl) 0;
|
||||
|
||||
.sizes-table-wrapper {
|
||||
margin-top: var(--spacing-lg);
|
||||
overflow-x: auto;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.sizes-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: var(--bg-secondary);
|
||||
|
||||
th {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-md);
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
border-bottom: 2px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.size-row {
|
||||
border-bottom: 1px solid var(--border-secondary);
|
||||
|
||||
td {
|
||||
padding: var(--spacing-md);
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.cidr-cell strong {
|
||||
color: var(--row-color);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.mask-cell code {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border-radius: var(--radius-xs);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.hosts-cell {
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.use-cell {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-note {
|
||||
margin-top: var(--spacing-md);
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
/* How it works section */
|
||||
.how-it-works {
|
||||
margin: var(--spacing-xl) 0;
|
||||
|
||||
.explanation-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
||||
gap: var(--spacing-lg);
|
||||
margin-top: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.explanation-item {
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
&.success {
|
||||
border-left: 4px solid var(--color-success);
|
||||
}
|
||||
|
||||
&.info {
|
||||
border-left: 4px solid var(--color-info);
|
||||
}
|
||||
|
||||
&.warning {
|
||||
border-left: 4px solid var(--color-warning);
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
p {
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.bit-example {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-sm);
|
||||
font-family: var(--font-mono);
|
||||
text-align: center;
|
||||
|
||||
.network-bits {
|
||||
color: var(--color-success);
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.host-bits {
|
||||
color: var(--color-info);
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.labels {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: var(--spacing-sm);
|
||||
font-size: var(--font-size-xs);
|
||||
|
||||
.network-label {
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.host-label {
|
||||
color: var(--color-info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.summary-example {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
gap: var(--spacing-md);
|
||||
align-items: center;
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
|
||||
.before, .after {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
font-size: var(--font-size-lg);
|
||||
color: var(--color-primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.planning-tip {
|
||||
background: color-mix(in srgb, var(--color-warning), transparent 90%);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--color-warning);
|
||||
font-size: var(--font-size-sm);
|
||||
|
||||
strong {
|
||||
color: var(--color-warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Quick reference section */
|
||||
.quick-reference {
|
||||
margin: var(--spacing-xl) 0;
|
||||
|
||||
.reference-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: var(--spacing-lg);
|
||||
margin-top: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.reference-card {
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
h3 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
padding-left: var(--spacing-md);
|
||||
position: relative;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
|
||||
&::before {
|
||||
content: '→';
|
||||
color: var(--color-primary);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.concepts-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.explanation-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.reference-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.summary-example {
|
||||
grid-template-columns: 1fr;
|
||||
text-align: center;
|
||||
|
||||
.arrow {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -68,7 +68,7 @@
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<header class="card-header row">
|
||||
<div class="left">
|
||||
<h2>{title}</h2>
|
||||
<p>{description}</p>
|
||||
|
||||
Whitespace-only changes.
@@ -1,184 +1,88 @@
|
||||
<script lang="ts">
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { setOperationsContent } from '$lib/content/cidr-set-operations';
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
|
||||
<section class="set-operations-reference">
|
||||
<h3>Set Operations Reference</h3>
|
||||
<p>
|
||||
Mathematical set operations allow you to combine, analyze, and manipulate IP address ranges
|
||||
systematically. Each operation serves different network analysis and management purposes.
|
||||
</p>
|
||||
<section class="reference">
|
||||
<h3>{setOperationsContent.title}</h3>
|
||||
<p>{setOperationsContent.description}</p>
|
||||
|
||||
<div class="operations-grid">
|
||||
<div class="operation-card">
|
||||
<div class="operation-header">
|
||||
<div class="operation-symbol">A ∪ B</div>
|
||||
<div class="operation-name">Union</div>
|
||||
{#each setOperationsContent.operations as operation}
|
||||
<div class="operation-card">
|
||||
<div class="operation-header">
|
||||
<div class="operation-symbol">{operation.symbol}</div>
|
||||
<div class="operation-name">{operation.name}</div>
|
||||
</div>
|
||||
<div class="operation-desc">{operation.description}</div>
|
||||
<div class="operation-example">
|
||||
<strong>Example:</strong> <code>{operation.example}</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation-desc">
|
||||
Combines all addresses from both sets. Results in addresses that are in A OR B.
|
||||
Useful for merging address allocations or creating comprehensive allow-lists.
|
||||
</div>
|
||||
<div class="operation-example">
|
||||
<strong>Example:</strong> <code>192.168.1.0/24 ∪ 192.168.2.0/24</code> = both networks
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="operation-card">
|
||||
<div class="operation-header">
|
||||
<div class="operation-symbol">A ∩ B</div>
|
||||
<div class="operation-name">Intersection</div>
|
||||
</div>
|
||||
<div class="operation-desc">
|
||||
Finds common addresses between sets. Results in addresses that are in BOTH A AND B.
|
||||
Essential for identifying conflicts or overlapping allocations.
|
||||
</div>
|
||||
<div class="operation-example">
|
||||
<strong>Example:</strong> <code>192.168.0.0/16 ∩ 192.168.1.0/24</code> = <code>192.168.1.0/24</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="operation-card">
|
||||
<div class="operation-header">
|
||||
<div class="operation-symbol">A - B</div>
|
||||
<div class="operation-name">Difference</div>
|
||||
</div>
|
||||
<div class="operation-desc">
|
||||
Removes B's addresses from A. Results in addresses that are in A but NOT in B.
|
||||
Critical for calculating remaining capacity or excluding reserved ranges.
|
||||
</div>
|
||||
<div class="operation-example">
|
||||
<strong>Example:</strong> <code>192.168.1.0/24 - 192.168.1.128/25</code> = <code>192.168.1.0/25</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="operation-card">
|
||||
<div class="operation-header">
|
||||
<div class="operation-symbol">A ⊆ B</div>
|
||||
<div class="operation-name">Containment</div>
|
||||
</div>
|
||||
<div class="operation-desc">
|
||||
Tests if A is completely contained within B. Returns boolean result plus coverage analysis.
|
||||
Valuable for validating subnet hierarchies and allocation compliance.
|
||||
</div>
|
||||
<div class="operation-example">
|
||||
<strong>Example:</strong> <code>192.168.1.0/25 ⊆ 192.168.1.0/24</code> = <code>true</code>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="common-patterns">
|
||||
<div class="patterns-section">
|
||||
<h4>Common Network Patterns</h4>
|
||||
<div class="patterns-grid">
|
||||
<div class="pattern-card">
|
||||
<h5><Icon name="shield" size="sm" /> Firewall Management</h5>
|
||||
<ul class="pattern-list">
|
||||
<li><strong>Allow Lists:</strong> Union of trusted networks</li>
|
||||
<li><strong>Conflicts:</strong> Intersection of allow/deny rules</li>
|
||||
<li><strong>Exceptions:</strong> Difference to exclude specific ranges</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card">
|
||||
<h5><Icon name="server" size="sm" /> IP Allocation</h5>
|
||||
<ul class="pattern-list">
|
||||
<li><strong>Available Space:</strong> Difference from allocated ranges</li>
|
||||
<li><strong>Overlaps:</strong> Intersection of allocation requests</li>
|
||||
<li><strong>Validation:</strong> Containment within authorized blocks</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card">
|
||||
<h5><Icon name="analytics" size="sm" /> Network Analysis</h5>
|
||||
<ul class="pattern-list">
|
||||
<li><strong>Coverage:</strong> Union of monitoring ranges</li>
|
||||
<li><strong>Gaps:</strong> Difference to find unmonitored areas</li>
|
||||
<li><strong>Redundancy:</strong> Intersection of backup networks</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card">
|
||||
<h5><Icon name="cloud" size="sm" /> Cloud Networks</h5>
|
||||
<ul class="pattern-list">
|
||||
<li><strong>VPC Planning:</strong> Union of required address space</li>
|
||||
<li><strong>Peering:</strong> Intersection analysis for conflicts</li>
|
||||
<li><strong>Segmentation:</strong> Difference for isolation</li>
|
||||
</ul>
|
||||
</div>
|
||||
{#each setOperationsContent.patterns as pattern}
|
||||
<div class="pattern-card">
|
||||
<h5><Icon name={pattern.icon} size="sm" /> {pattern.title}</h5>
|
||||
<ul>
|
||||
{#each pattern.items as item}
|
||||
<li><strong>{item.term}:</strong> {item.description}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="implementation-notes">
|
||||
<div class="notes-section">
|
||||
<h4>Implementation Notes</h4>
|
||||
<div class="notes-grid">
|
||||
<div class="note-item">
|
||||
<h5>IPv4 vs IPv6</h5>
|
||||
<p>
|
||||
All operations process IPv4 and IPv6 addresses separately. You cannot perform
|
||||
set operations between different IP versions - they operate in distinct address spaces.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note-item">
|
||||
<h5>CIDR Optimization</h5>
|
||||
<p>
|
||||
Results are automatically optimized into minimal CIDR representations.
|
||||
Complex operations may require multiple CIDR blocks to exactly represent the result.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note-item">
|
||||
<h5>Range Normalization</h5>
|
||||
<p>
|
||||
Input ranges are normalized and merged before operations. Overlapping inputs
|
||||
within the same set are automatically combined for accurate results.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note-item">
|
||||
<h5>Performance Considerations</h5>
|
||||
<p>
|
||||
Operations are optimized for network-sized ranges. Very large address spaces
|
||||
or numerous small ranges may require additional processing time.
|
||||
</p>
|
||||
</div>
|
||||
{#each setOperationsContent.notes as note}
|
||||
<div class="note-item">
|
||||
<h5>{note.title}</h5>
|
||||
<p>{note.content}</p>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="best-practices-box">
|
||||
<div class="best-practices info-panel info">
|
||||
<h4>Best Practices</h4>
|
||||
<ul>
|
||||
<li><strong>Validate Inputs:</strong> Always verify CIDR notation and IP formats before operations</li>
|
||||
<li><strong>Document Operations:</strong> Export results and maintain records of set operations</li>
|
||||
<li><strong>Test in Stages:</strong> For complex operations, break into smaller steps for verification</li>
|
||||
<li><strong>Monitor Results:</strong> Use visualization to verify operations produce expected outcomes</li>
|
||||
{#each setOperationsContent.bestPractices as practice}
|
||||
<li><strong>{practice.term}:</strong> {practice.description}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
.set-operations-reference {
|
||||
.reference {
|
||||
margin-top: var(--spacing-xl);
|
||||
padding: var(--spacing-xl);
|
||||
background-color: var(--bg-secondary);
|
||||
border-radius: var(--radius-lg);
|
||||
|
||||
|
||||
h3 {
|
||||
color: var(--color-primary);
|
||||
margin-bottom: var(--spacing-md);
|
||||
font-size: var(--font-size-lg);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
h4 {
|
||||
color: var(--text-primary);
|
||||
margin: var(--spacing-xl) 0 var(--spacing-md) 0;
|
||||
font-size: var(--font-size-md);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
h5 {
|
||||
color: var(--color-primary);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
@@ -188,7 +92,7 @@
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
|
||||
> p {
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -196,58 +100,57 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Operations grid */
|
||||
.operations-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.operation-card {
|
||||
padding: var(--spacing-md);
|
||||
background-color: var(--bg-primary);
|
||||
background-color: var(--bg-tertiary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
|
||||
.operation-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
|
||||
|
||||
.operation-symbol {
|
||||
font-size: var(--font-size-xl);
|
||||
font-weight: bold;
|
||||
color: var(--color-primary);
|
||||
width: 69px;
|
||||
width: 70px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.operation-name {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-md);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.operation-desc {
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.5;
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
|
||||
.operation-example {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-tertiary);
|
||||
background-color: var(--bg-secondary);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
|
||||
|
||||
strong {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
|
||||
code {
|
||||
font-family: var(--font-mono);
|
||||
background-color: var(--bg-secondary);
|
||||
@@ -258,60 +161,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Common patterns */
|
||||
.patterns-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
.patterns-section,
|
||||
.notes-section {
|
||||
.patterns-grid,
|
||||
.notes-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
}
|
||||
|
||||
.pattern-card {
|
||||
.notes-section .notes-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
|
||||
}
|
||||
|
||||
.pattern-card,
|
||||
.note-item {
|
||||
padding: var(--spacing-md);
|
||||
background-color: var(--bg-primary);
|
||||
background-color: var(--bg-tertiary);
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-left: 4px solid var(--color-info);
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
|
||||
h5 {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.pattern-list {
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
|
||||
li {
|
||||
margin-bottom: var(--spacing-xs);
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
|
||||
|
||||
strong {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Implementation notes */
|
||||
.notes-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.note-item {
|
||||
padding: var(--spacing-md);
|
||||
background-color: var(--bg-primary);
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
h5 {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
@@ -320,8 +211,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Best practices */
|
||||
.best-practices-box {
|
||||
.pattern-card {
|
||||
border-left: 4px solid var(--color-info);
|
||||
}
|
||||
|
||||
.best-practices {
|
||||
background-color: var(--bg-primary);
|
||||
border: 1px solid var(--color-info);
|
||||
border-radius: var(--radius-md);
|
||||
@@ -341,15 +235,17 @@
|
||||
margin-bottom: var(--spacing-xs);
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
position: relative;
|
||||
padding-left: 1em;
|
||||
|
||||
&::before {
|
||||
content: "•";
|
||||
color: var(--color-info);
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
margin-right: var(--spacing-xs);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
|
||||
strong {
|
||||
color: var(--color-info);
|
||||
}
|
||||
@@ -357,15 +253,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.operations-grid,
|
||||
.patterns-grid,
|
||||
.notes-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.operation-header {
|
||||
|
||||
.operation-card .operation-header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
gap: var(--spacing-sm);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<script lang="ts">
|
||||
import ToolsGrid from '$lib/components/global/ToolsGrid.svelte';
|
||||
import { SUB_NAV, type NavGroup, type NavItem } from '$lib/constants/nav';
|
||||
|
||||
// Extract set operations tools from the CIDR section
|
||||
const cidrNav = SUB_NAV['/cidr'] || [];
|
||||
const setOperationsGroup = cidrNav.find((item): item is NavGroup =>
|
||||
'title' in item && item.title === 'Set Operations'
|
||||
);
|
||||
const setOperationTools = setOperationsGroup?.items || [];
|
||||
</script>
|
||||
|
||||
<h2>Set Operation Tools</h2>
|
||||
<ToolsGrid tools={setOperationTools} />
|
||||
Reference in new issue
Block a user