LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2018, 08:37 PM   #1
blindrain
LQ Newbie
 
Registered: Jul 2018
Posts: 1

Rep: Reputation: Disabled
Exclamation Centos 6 Kernel static Routes and OpenVPN


I'm having issues with Static routes not getting added to my servers Kernel Routes for my vpn clients.

So that I can use an internal IP to connect to that server.

I have narrowed down my issue to the route is actually missing on the server for the lans on my vpn client.

All of my clients can connect and communicate with each other.
but my server can only connect to the actual clients not any of their lans.


Code:
C:\Users\BlindRain>tracert 192.168.255.3

Tracing route to 192.168.255.3 over a maximum of 30 hops

  1     2 ms    <1 ms    <1 ms  192.168.200.1
  2   729 ms   742 ms   703 ms  10.8.0.253
  3   788 ms  1010 ms   730 ms  192.168.255.3

Trace complete.

C:\Users\BlindRain>tracert 192.168.253.83

Tracing route to 192.168.253.83 over a maximum of 30 hops

  1    14 ms     8 ms    12 ms  192.168.200.1
  2   177 ms   143 ms   258 ms  192.168.253.83

Trace complete.



C:\Users\BlindRain>
So you can see my traffic is traveling over the vpn.

VPN Servers Kernel Routing table.
Code:
[root@vps ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.255.255.1    *               255.255.255.255 UH    0      0        0 eth0
172.18.18.0     *               255.255.255.0   U     0      0        0 eth1
10.8.0.0        *               255.255.255.0   U     0      0        0 tun2
10.25.0.0       *               255.255.255.0   U     0      0        0 tun0
10.7.0.0        *               255.255.255.0   U     0      0        0 tun1
10.4.100.0      10.255.255.1    255.255.254.0   UG    0      0        0 eth0
10.4.98.0       10.255.255.1    255.255.254.0   UG    0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
default         10.255.255.1    0.0.0.0         UG    0      0        0 eth0
Code:
[root@vps ~]# cat /etc/sysconfig/network-scripts/route-tun2
192.168.0.0/16 via 10.8.0.2 dev tun2
172.16.0.0/12 via 10.8.0.2 dev tun2
10.0.0.0/8 via 10.8.0.2 dev tun2
this file works only when vpn server is already running and I restart my network service.

Code:
[root@vps ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down interface eth1:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
                                                           [  OK  ]
Bringing up interface eth1:  Determining if ip address 172.18.18.1 is already in use for device eth1...
                                                           [  OK  ]
[root@vps ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.255.255.1    *               255.255.255.255 UH    0      0        0 eth0
172.18.18.0     *               255.255.255.0   U     0      0        0 eth1
10.8.0.0        *               255.255.255.0   U     0      0        0 tun2
10.25.0.0       *               255.255.255.0   U     0      0        0 tun0
10.7.0.0        *               255.255.255.0   U     0      0        0 tun1
10.4.100.0      10.255.255.1    255.255.254.0   UG    0      0        0 eth0
10.4.98.0       10.255.255.1    255.255.254.0   UG    0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
192.168.0.0     10.8.0.2        255.255.0.0     UG    0      0        0 tun2
172.16.0.0      10.8.0.2        255.240.0.0     UG    0      0        0 tun2
10.0.0.0        10.8.0.2        255.0.0.0       UG    0      0        0 tun2
default         10.255.255.1    0.0.0.0         UG    0      0        0 eth0
[root@vps ~]#

how do I resolve this.

I have this in my config file

Code:
route 192.168.0.0 255.255.0.0
route 172.16.0.0 255.240.0.0
route 10.0.0.0 255.0.0.0
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in adding static routes in centos 6.5 adisoftronics Linux - Networking 2 04-05-2014 09:50 PM
OpenVPN assigning public & static IPs to pcs/devices behind an OpenVPN client dgonzalezh Linux - Networking 6 07-18-2010 09:50 AM
permanent static routes on CentOS/Red Hat Enterprise Linux whistl Linux - Networking 4 03-24-2009 12:30 PM
OpenVPN and routes watcher69b Linux - Networking 1 12-14-2008 09:09 PM
Static routes using routes/ifroutes-eth-id.. files and default gateway disabled TimtheEagle Linux - Networking 0 05-31-2008 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration