Viewing posts for the category Omarine User's Manual

Building a fault-tolerant firewall system with virtual machines: Introduction

Combining netfilter connection tracking tool conntrackd with HA (High Availability) service using keepalived we can build a fault tolerant firewall system. With qemu and spice, the system is built based on virtual machines that are almost as friendly as the physical ones. Users can use virtual machines remotely via the spice protocol and can perform copy and paste operations between virtual machines and the real machine and between virtual machines. We can also redirect USB from the real machine to the virtual machine and then use the USB devices on the virtual machine with the feeling of using them on a physical machine.
This series of articles introduces building and running a fault-tolerant firewall system through a real-world example. Among them are techniques for creating virtual network interfaces, designing virtual machines using qemu command input parameters, accessing and using remote virtual machines using spice, running spice agent on virtual machines to communicate with spice server on the host, configuring X to use the qxl video driver on the virtual machines, configuring network interfaces using systemd, routing, network address translation , configuring HA and running keepalived on the firewall machines, integrating conntrackd into the system and running conntrackd.service on firewall machines, etc. Finally, a set of stateful packet filtering rules are set up, precise to each specific network interface on the firewall machines to specify which services the client is allowed to access on the server.
In the figure below, when the machine client wants to access any service on the server omarine every packets must go through a firewall system consisting of two machines fw-1 and fw-2. This is the primary/backup model of the HA system. Only one firewall machine at a time is responsible for packet filtering. If fw-1 starts first it will be the primary firewall, machine fw-2 is the backup. When the client accesses omarine, a packet with a destination address of will go out at the interface eth0. It goes through the bridge br1 and then to the firewall fw-1 at the interface eth1. The packet does not go inside the firewall machine but is forwarded from the eth1 interface to eth0 interface. The packet filtering rule set is active from the moment eth1 receives the packet. It will decide to allow or drop the packet on the floor. If accepted, the packet is sent from the firewall's eth0 interface, across the bridge br0, and then into omarine at the eth0 interface

Although the firewall fw-2 does not perform packet filtering, it is replicated conntrack states through the eth2 interfaces between two firewalls connected via the br2 bridge.
If the firewall fw-1 fails, the firewall fw-2 immediately becomes active. Because of its full packet filtering tracking states, the firewall fw-2 from the moment of handover is able to distinguish a connection as established or a new one, and becomes primary firewall effectively

Here is a series of snapshots from the actual activity

I Ching Algorithm: Construction of Apparent Stems and Branches – Season coordinate system and Nine Stars of the Day

The Nine Stars of the Day starts from the first day of the Stems and Branches era, which is the day of the Jia-Rat. Like the Nine Stars of the Hour, the Nine Stars of the Day are also divided into two periods of the year. In the first six months of the year, from the Winter Solstice period, the yang qi goes up, so the Nine Stars goes forward, that is, in the increasing direction of the number of Luoshu, starting from White One - Water Star. In the last six months of the year, from the Summer Solstice period, the yin qi goes down and the Nine Stars goes backward, starting from the Burgundy Nine - Fire Star. Six months is equivalent to 180 days, ie three rounds of the Jia-Rat, so in the last six months the Nine Stars also starts from the day of the Jia-Rat.
The Nine Stars of the Day must satisfy the following requirements:
     • Going forward from Winter Solstice to the end of "Grain in ear" period and going backward from Summer Solstice until the end of Great Snow period.
     • The Nine Stars must move around continuously. For example, from 5-Yellow must go up to 6-White or go down to 4-Green throughout the year.
     • There must be a reasonable continuity when changing periods from "Grain in ear" to Summer Solstice in the year and from Great Snow at the end of this year to the Winter Solstice at the beginning of the next year.
However, the problem arises because a year has 365 days or 366 days, not even 360 days for two regions of yang and yin qi. The first day of the Winter Solstice is not the day of the Jia-Rat.
This year's Winter Solstice is the Day of the Wu-Dog, nearly a month away from the Day of the Jia-Rat. If the Nine Stars is allowed to move continuously, it is unacceptable for the two regions of yang and yin qi to be encroached on each other for about a month.
Current books also give a way to look up the Nine Stars by starting the day of the Jia-Rat according to the weather periods. For example, Summer Solstice starts the day of the Jia-Rat from 9-Burgundy, and the "Heat ends" starts the day of the Jia-Rat from 3-Blue. It is now "Autumn starts" period. On August 23, it is time to enter the "Heat ends" period. August 23 is the day of the Gui-Rabbit, starting the Jia-Rat from 3-Blue, the Nine Stars goes backwards, so the day of the Gui-Rabbit has the qi field of 9-Burgundy. One day back is the day of the Ren-Tiger, this day is still in the "Autumn starts" period, which is the period from the Summer Solstice to the end of "Autumn starts", so taking the Summer Solstice starting the day of the Jia-Rat from the 9-Burgundy, inferring the day of the Ren-Tiger is 7-Red. Ren-Tiger and Gui-Rabbit are two consecutive days, the qi field cannot jump from 7-Red to 9-Burgundy!
The reason the current calculation of the qi field is not correct is because the current Stems and Branches system cannot be used as the coordinate system of the qi field space.

1) Immobilization of the transition qi field
While walking, if you want to go back, you have to stop first. The curve of a function goes up when the derivative is positive. Before going down to the negative derivative, it must pass through the maximum point at which the derivative is zero, where the function value is constant.
Nine Stars goes from the Winter Solstice with the 1-White qi field in the Yang qi region, after 180 days, it reaches the 9-Burgundy qi field on the last day of the "Grain in ear" period. It must keep the 9-Burgundy in order to transition to the Yin region starting from the Summer Solstice period

I Ching Algorithm: Nine Stars of the Month, Nine Stars of the Hour

This article considers the Nine Stars of the Month and the Nine Stars of the Hour. As for the Day, the determination of the Nine Stars is relatively complicated and the calculation that has been handed down so far is wrong, so we will build the Nine Stars of the Day in a separate article.

24 weather periods
The Sun moves in the Zodiac exactly one round is a 365.25-day weather year. Divide the zodiac circle 360 ​​degrees into 12 arcs, each of them 30 degrees. The start time of each arc with one weather period, is counted as the beginning of a weather month.
In the middle of each arc, that is, between each month, is one middle period.
Total 24 periods, we have the following table:

I Ching Algorithm: How to study, apply and develop the I Ching?

There's a little story. Eight Lake Feng Shui was mistaken when assigning Flying Sector with a hexagram. Flying Sector, Flying Star, Destiny Sector or Birth Sector are different names of the Nine Stars according to each person's year of birth.
Considering a man born in the year of the Geng-Horse in 1990, looking up the table of Jia-Rat Round With Three Epochs, the Nine Stars is White One. Feng Shui has assigned this Flying Sector with the hexagram Water, creating a contradiction with the Nine Stars. In the picture below, on the left is the Nine Stars. The whole is Water qi. For White One's destiny, of course, the best direction is North because White Six - Metal Star both mutual interacts with the Heaven Center and generates the earth's qi, which is enhanced by the Heaven Center. But on the right, because of self-assignment of the Water hexagram, Eight Lake Feng Shui thinks that the North is "Return", which is the least good direction. Similarly, the Southwest direction of the Red Seven  - Metal Star is completely mutual and cannot be "Death" as the conclusion of Eight Lake Feng Shui

I Ching Algorithm: The Luo River Diagram and the forecast of Three Epochs - Nine Fortunes

When it comes to the Eight Trigrams, it is impossible not to mention The Luo River Diagram
We know that the Eight Trigrams defines 8 directions in space. That is geospatial, static space. But the universe is in constant motion, so the qi fields of the universe affecting life on the ground are always changing. The calendar method with astronomical survey results shows that the qi field changes of the universe are cyclical and follow the laws of motion of 9 stars on the table. 9 stars correspond to 9 numbers of The Luo River Diagram (abbreviated as Luoshu) and the stars "fly" on the table according to the law of moving numbers, in two directions of ups and downs. The changing numbers form the basis of the spatial variation of the qi fields of the universe. From there, the Nine Stars Destiny was born.
In this article we use modern science to further strengthen the theory of Nine Stars Destiny.
While the Eight Trigrams is made up of 8 binary numbers, Luoshu consists of 9 decimal numbers. Luoshu numbers moves starts from the center, with the number 5 first. In the ascending direction, 5 to 6, 6 to 7, 7 to 8, 8 to 9, 9 into 1, 1 to 2, 2 to 3, 3 to 4, 4 to 5. Then start again from the center, 6 to 7, 7 to 8, …, etc. In the descending direction, 5 to 4, 4 to 3, 3 to 2, 2 to 1, 1 into 9, 9 to 8, 8 to 7, 7 to 6, 6 to 5. Then start again from the center, 4 to 3, 3 to 2, …, etc. The increase (or decrease) of Luoshu numbers goes through 9 steps back to their original form. Each step a Luoshu number (or Nine Stars number) located in the center of the table representing one of the 9 qi fields in heaven and earth that govern the whole of human life.

The calendar-makers of the Song dynasty, China calculated the year Sui King ascended the throne, ie 604, the year of the planet Metal, Wood, Water, Fire, Earth and the Moon, the Sun being on the same line with the Earth called Seven Stars Meeting. This time is considered to be the beginning of the Stems-and-Branches era, i.e. the year of the Jia-Rat, the month of the Jia-Rat, the day of the Jia-Rat, and is the timeline of a 180-year weather cycle. It took 180 years to see Seven Stars Meeting again and the weather returned to the way it was.
A Jia-Rat round is 60 years, so 180 years includes 3 Jia-Rat rounds, called a Three Epochs consisting of three Epochs. The first Epoch or first Jia-Rat round is Upper Epoch. The second round is Middle Epoch. The third round is Lower Epoch. Every 60 years is a Great Fortune, and it is divided into three Little Fortunes, 20 years each, known as Fortune for short. Upper Epoch includes Fortune 1, Fortune 2, and  Fortune 3. Middle Epoch includes Fortune 4, Fortune 5, and Fortune 6. Lower Epoch includes Fortune 7, Fortune 8, Fortune 9. Nine Fortunes fits nine numbers of The Luo River Diagram, nine stars and nine qi fields. The Fortunes are taken by name corresponding to the numbers of Luoshu. Fortune 1 is White One. Fortune 2 is Black Two. Fortune 3 is Blue Three. Fortune 4 is the Green Four. Fortune 5 is Yellow Five. Fortune 6 is White Six. Fortune 7 is Red Seven. Fortune 8 is White Eight. Fortune 9 is Burgundy Nine.

Why 9 numbers?
Under historical factors, there was no zero in The Luo River Diagram's time. The ancients could only represent numbers by black and white dots. Below is The Luo River Diagram chart