Posts Tagged ‘confusion’

How to make GRE tunnel iptables port redirect on Linux

Saturday, August 20th, 2011

I’ve recently had to build a Linux server with some other servers behind the router with NAT.
One of the hosts behind the Linux router was running a Window GRE encrypted tunnel service. Which had to be accessed with the Internet ip address of the server.
In order < б>to make the GRE tunnel accessible, a bit more than just adding a normal POSTROUTING DNAT rule and iptables FORWARD is necessery.

As far as I’ve read online, there is quite of a confusion on the topic of how to properly configure the GRE tunnel accessibility on Linux , thus in this very quick tiny tutorial I’ll explain how I did it.

1. Load the ip_nat_pptp and ip_conntrack_pptp kernel module

linux-router:~# modprobe ip_nat_pptp
linux-router:~# modprobe ip_conntrack_pptp

These two modules are an absolutely necessery to be loaded before the remote GRE tunnel is able to be properly accessed, I’ve seen many people complaining online that they can’t make the GRE tunnel to work and I suppose in many of the cases the reason not to be succeed is omitting to load this two kernel modules.

2. Make the ip_nat_pptp and ip_nat_pptp modules to load on system boot time

linux-router:~# echo 'ip_nat_pptp' >> /etc/modules
linux-router:~# echo 'ip_conntrack_pptp' >> /etc/modules

3. Insert necessery iptables PREROUTING rules to make the GRE tunnel traffic flow

linux-router:~# /sbin/iptables -A PREROUTING -d 111.222.223.224/32 -p tcp -m tcp --dport 1723 -j DNAT --to-destination 192.168.1.3:1723
linux-router:~# /sbin/iptables -A PREROUTING -p gre -j DNAT --to-destination 192.168.1.3

In the above example rules its necessery to substitute the 111.222.223.224 ip address withe the external internet (real IP) address of the router.

Also the IP address of 192.168.1.3 is the internal IP address of the host where the GRE host tunnel is located.

Next it’s necessery to;

4. Add iptables rule to forward tcp/ip traffic to the GRE tunnel

linux-router:~# /sbin/iptables -A FORWARD -p gre -j ACCEPT

Finally it’s necessery to make the above iptable rules to be permanent by saving the current firewall with iptables-save or add them inside the script which loads the iptables firewall host rules.
Another possible way is to add them from /etc/rc.local , though this kind of way is not recommended as rules would add only after succesful bootup after all the rest of init scripts and stuff in /etc/rc.local is loaded without errors.

Afterwards access to the GRE tunnel to the local IP 192.168.1.3 using the port 1723 and host IP 111.222.223.224 is possible.
Hope this is helpful. Cheers 😉

Russians Celebrate Christmas / Why some Orthodox Christians celebrate Nativity ( Christmas ) on 7th of January

Tuesday, January 7th, 2014

rojdestvo_Iisusa_Hrista_17th-vek-srpska-ikona

Merry Christmas to all Eastern Orthodox Christians!

I wish to all my Russian blog readers Christ's blessings, Wisdom of the 3 Wise man following the star. Humility of Christ for being born in a Cave and love of Mother of God Virgin Mary and Joseph to the incarnated Lord in flesh, Joy of the universe for the Universe rejoiced seing the birth of the savior of us sinful humans!

On 7th of January, the day on which biggest part of Eastern Orthodox Church,- Russian Orthodox Church along with Ukrainian, Macedonian, Croation, Serbian Arabic and part of Greek orthodox Church and Holy Mount Athos celebrate the day of Christ's birth. The original place where the Lord Jesus Christ was born as we read in the Gospels is BethlehemAccording to Church tradition on top of the Cave (known as Grotto) where the savior was born a Church basilica was built around year 333 A.D..

church of nativity bethlehem nowadays palestine - Jesus Christ birth place

The first Church building on top of Nativity Cave begun by Saint Helena, the mother of saint Emperor Constantine.

the_cave_of_nativity-where-Christ-was-born

The Basilica was destroyed a couple of times throughout the 3th, 4th, 5th, 10-th , 14-th and 18-th centuries in attempt to wipe out memory for Christ's birth and futile attempt of early times Roman emperors to destroy christianity.
Today Bethlehem Church is situated on Palestinian territories and place for pilgrimage of both Eastern Orthodox and Roman Catholic Christians. Its
interior is a very interesting mixture of a classic Orthodox Christian and a Roman Catholic basillica.

Church of the Holy Nativity Christs birth place Bethlehem

There is plenty of confusion and misunderstanding on the topic why bigger part of Christians worldwide celebrate Christmas on 24th against 25th of December and why more than half of Eastern Orthodox Christians celebrate on 6th against of 7th of January?

In fact it is interesting fact that in the early Christian one holy apostolic Church, Christmas and Eastern was celebrated many times as this two feasts since beginning of the Church are center of Christian faith. In later times, when Church was already formed as an Eastern and Western Church, there are Church canons on exact date to celebrate Christmas and Eastern following the Julian Calendar (introduced by Julius Caesar in 46 BC). In later times with development of Science it was found that this calendar was not so precise and another Church calendar was introduced in y. 1582 by Roman Catholic pope Gregory XVIII (Gregorian Calendar named after pope). I will not get into details but from modern science Astronomical point of view Gregorian calendar is more scientifically correct. The Gregorian calendar quickly become in secular life because of its mathematical precision. And by Western Roman Catholic church Influence and desire to be more scientifically correct parts of the Eastern Orthodox Church partly accepted use of the Gregorian Calendar for counting the Church feasts. Because of that many of the feasts in those Eastern Orthodox Churches moved in forward with 13 days like the Romanian and Bulgarian Orthodox Church. However due to Church canon part of the feasts in Eastern Church can't be celebrated according to the Gregorian Calendar dates. Most important feast dates is the Resurrection day (Eastern), which according to Orthodox Church rule has always to be one week after the Jewish Pascha. There are plenty of problems that emerged due to change of acceptance of reformed Church calendar in part of the Eastern Orthodox Church, however what is most important is that the difference doesn't separate Orthodox Christian it just gives us reason to celebrate feast twice 🙂