Solved dynamic routing protocol & openvpn

Hi to community

I'd like to to discuss a question about the OpenVPN separate tunnel for a web service. The service working on the network gateway, and must have a separate (second) tunnel to OpenVPN remote server as client.

The gateway has a 2 subnets and PPP tun0 interface to internet provider.

Code:
subnet one
192.168.1.1/25
Subnet two
192.168.1.128/25 - for the web service

-----------------------------------------------
PPP interface to provider
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
  options=80000<LINKSTATE>
  inet 10.4.5.121 --> 10.254.253.253 netmask 0xffffff00
 

The OpenVPN p2p interface, when starting without setfib

tun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
  options=80000<LINKSTATE>
  inet 10.12.0.126 --> 10.12.0.125 netmask 0xffffffff
I need to organize OpenVPN tunnel from web service subnet and i want to
use an addition routing table with setfib.

But got en error
Code:
setfib 1 openvpn FreeVPN.me-UDP-53.ovpn
.......................
Thu Dec 17 19:37:17 2015 write UDPv4: Network is unreachable (code=51)
Thu Dec 17 19:37:19 2015 write UDPv4: Network is unreachable (code=51)
Thu Dec 17 19:37:24 2015 write UDPv4: Network is unreachable (code=51)

-------------------------
The kernel has
Code:
option ROUTETABLES=2
-------------------------
I think, I have to use dynamic routing protocol OSPF with OpenVPN, but I need help, because I did not that task before.

Thanks......
 
Last edited by a moderator:
  • Thanks
Reactions: Oko
Hay..... somebody knows sonething more about?
No?

whereas can write any more.

Found a solution, but without dynamic routing protocol.
At first, we are have to rise a first tunnel, for access to OpenVPN server router. For example throuth tun2 interface.

Code:
openvpn config_tun2.ovpn
.....
Initialization Sequence Completed

And then, a second OpenVPN tunnel, throuth another tun interface, for example, tun3 to this OpenVPN service. But with a second routing table

Code:
setfib 1 openvpn config_tun3.ovpn
.........

Initialization Sequence Completed

The difference between configs is in a tun interface numbers only.
Need a stop the first OpenVPN process, and all uneeded routing strings will deleted from the fib 0 routing table automaticaly. But the second (tun3) tunnel continue to be established.....

That`s all. There are 2 separate routing tables fib0 and fib1 & additional OpenVPN tunnel.
 
Last edited:
Back
Top