<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2017 on Ricky</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/</link><description>Recent content in 2017 on Ricky</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 15 Dec 2017 15:33:14 +0800</lastBuildDate><atom:link href="https://9855cc0f.linzeyan.pages.dev/posts/2017/index.xml" rel="self" type="application/rss+xml"/><item><title>Representative HTTP Status Codes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171215-6844903519447678990/</link><pubDate>Fri, 15 Dec 2017 15:33:14 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171215-6844903519447678990/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://juejin.cn/post/6844903519447678990" target="_blank" rel="noopener">Representative HTTP Status Codes&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Switch notes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171125-cisco/</link><pubDate>Sat, 25 Nov 2017 11:47:37 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171125-cisco/</guid><description>&lt;h4 id="switch">Switch&lt;/h4>
&lt;p>&lt;strong>&lt;em>Switches are usually L2 devices&lt;/em>&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>They forward packets only to the destination host (based on the MAC table), which reduces collisions and eavesdropping. Switches can also handle packets arriving at the same time, while hubs cannot.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>&lt;em>Hubs are L1 devices&lt;/em>&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>They forward packets from any host to all connected hosts, so collisions happen and cause random retries.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>&lt;em>MAC Table&lt;/em>&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>Learning
&lt;ul>
&lt;li>A packet arrives on some port (network A) from MAC X destined for MAC Y. The switch records that MAC X is on network A. This is called learning.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Flooding
&lt;ul>
&lt;li>The switch does not yet know where MAC Y is, so it forwards the packet to all networks except A. This is called flooding.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Forwarding
&lt;ul>
&lt;li>The host with MAC Y receives the packet and sends an ACK to MAC X. The switch records that MAC Y is on that network, then forwards the ACK to MAC X. This is forwarding.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Filtering
&lt;ul>
&lt;li>The switch receives a packet and finds that the source and destination MACs are on the same network, so it drops the packet. This is filtering.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Aging
&lt;ul>
&lt;li>Each MAC-table entry has a timestamp of last access. Entries older than a threshold (configurable) are removed. This is aging.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;h5 id="vlan">Vlan&lt;/h5>
&lt;p>Switch interfaces must support 802.1Q&lt;/p></description></item><item><title>Juniper notes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171123-juniper/</link><pubDate>Thu, 23 Nov 2017 16:00:00 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171123-juniper/</guid><description>&lt;h4 id="juniper-firewall-tunnel">[Juniper Firewall] tunnel&lt;/h4>
&lt;p>&lt;strong>&lt;em>ACG&lt;/em>&lt;/strong>
&lt;code>icare@TWCHIJF01# show | compare rollback 4&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-diff" data-lang="diff">&lt;span style="display:flex;">&lt;span>[edit security policies]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> from-zone DB_12 to-zone TCT_Office { ... }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ from-zone DB_12 to-zone JC32 {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ policy For_Backup {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ match {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ source-address DB_10.11.12.0/24;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ destination-address BACKUP_10.32.32.130;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ application any;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ then {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ permit;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">&lt;/span>[edit security zones security-zone DB_12 address-book]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> address DB_10.11.12.57 { ... }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ address DB_10.11.12.0/24 10.11.12.0/24;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">&lt;/span>[edit security zones]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> security-zone ESB_15 { ... }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ security-zone JC32 {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ address-book {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ address BACKUP_10.32.32.130 10.32.32.130/32;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ host-inbound-traffic {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ system-services {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ ping;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ interfaces {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ gr-0/0/0.32;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">&lt;/span>[edit interfaces gr-0/0/0]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ unit 32 {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ description To_JC32_DBBackup;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ tunnel {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ source 202.168.193.128;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ destination 218.253.210.8;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ family inet {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ address 10.32.0.101/30;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ }
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">&lt;/span>[edit routing-options static]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> route 0.0.0.0/0 { ... }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">+ route 10.32.32.130/32 next-hop 10.32.0.102;
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;pre tabindex="0">&lt;code>set security policies from-zone DB_12 to-zone JC32 policy For_Backup match source-address DB_10.11.12.0/24
set security policies from-zone DB_12 to-zone JC32 policy For_Backup match destination-address BACKUP_10.32.32.130
set security policies from-zone DB_12 to-zone JC32 policy For_Backup match application any
set security policies from-zone DB_12 to-zone JC32 policy For_Backup then permit
set security zones security-zone DB_12 address-book address DB_10.11.12.0/24 10.11.12.0/24
set security zones security-zone JC32 address-book address BACKUP_10.32.32.130 10.32.32.130/32
set security zones security-zone JC32 host-inbound-traffic system-services ping
set security zones security-zone JC32 interfaces gr-0/0/0.32
set interfaces gr-0/0/0 unit 32 description To_JC32_DBBackup
set interfaces gr-0/0/0 unit 32 tunnel source 202.168.193.128
set interfaces gr-0/0/0 unit 32 tunnel destination 218.253.210.8
set interfaces gr-0/0/0 unit 32 family inet address 10.32.0.101/30
set routing-options static route 10.32.32.130/32 next-hop 10.32.0.102
&lt;/code>&lt;/pre>&lt;p>&lt;code>icare@TWCHIJF01&amp;gt; show configuration | compare rollback 1&lt;/code>&lt;/p></description></item><item><title>Data Center Notes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171024-data-center/</link><pubDate>Tue, 24 Oct 2017 23:17:33 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20171024-data-center/</guid><description>&lt;p>First NIC - blue cable&lt;/p>
&lt;p>Second NIC - green cable&lt;/p>
&lt;p>Switch interconnect - white cable&lt;/p>
&lt;p>Yellow, red&lt;/p>
&lt;p>Storage has disk arrays and heavy data transfer, so it uses fiber connections and fiber switches.&lt;/p>
&lt;p>Fiber colors:&lt;/p>
&lt;p>Multi-mode or single-mode fiber&lt;/p>
&lt;p>Single-mode fiber is yellow. Multi-mode fiber (50μm or 62.5μm) is usually orange. 10GB multi-mode fiber is usually aqua.&lt;/p>
&lt;p>Common spec distinctions:&lt;/p>
&lt;ul>
&lt;li>OS1, OS2, 9µm, 9/125 = single-mode fiber&lt;/li>
&lt;li>OM1, 62.5µm, 62.5/125 = 62.5 multi-mode fiber&lt;/li>
&lt;li>OM2, 50µ, 50/125 = 50 multi-mode fiber&lt;/li>
&lt;li>OM3, 10GB, 50µm, 50/125 = 10GB multi-mode fiber&lt;/li>
&lt;li>OM4, 100GB, 50µm, 50/125 = 100GB multi-mode fiber&lt;/li>
&lt;/ul>
&lt;p>Fiber structure&lt;/p></description></item><item><title>Route notes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20170916-route/</link><pubDate>Sat, 16 Sep 2017 15:00:00 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20170916-route/</guid><description>&lt;p>Router - a device that is good at computing routing tables, an L3 device.&lt;/p>
&lt;p>Routing Table&lt;/p>
&lt;ul>
&lt;li>A NIC with one IP naturally has two routes and they cannot be changed. 192.168.1.1/24
&lt;ul>
&lt;li>Itself. Local route / Host route: 192.168.1.1/32&lt;/li>
&lt;li>The whole subnet. Direct route / Connect route: 192.168.1.0/24&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>You can add as many static routes as you want.
&lt;ul>
&lt;li>172.10.10.10/24 -&amp;gt; 192.168.1.2&lt;/li>
&lt;li>2.2.2.2/26 -&amp;gt; 192.168.1.9&lt;/li>
&lt;li>&amp;hellip;&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Default route - only one gateway.
&lt;ul>
&lt;li>0.0.0.0/0 -&amp;gt; 192.168.1.10&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>More specific routes take precedence.&lt;/li>
&lt;li>BGPv4&lt;/li>
&lt;/ul></description></item><item><title>Arp notes</title><link>https://9855cc0f.linzeyan.pages.dev/posts/2017/20170903-arp/</link><pubDate>Sun, 03 Sep 2017 15:00:00 +0800</pubDate><guid>https://9855cc0f.linzeyan.pages.dev/posts/2017/20170903-arp/</guid><description>&lt;p>Before a packet is sent&lt;/p>
&lt;ul>
&lt;li>Look up the MAC for the IP in the ARP table
&lt;ul>
&lt;li>MAC found - encapsulate&lt;/li>
&lt;li>No MAC - broadcast
&lt;ul>
&lt;li>Same subnet - OK&lt;/li>
&lt;li>Different subnet - look up the router MAC in the ARP table
&lt;ul>
&lt;li>Found - OK&lt;/li>
&lt;li>Not found - broadcast&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul></description></item></channel></rss>