LinuxQuestions.org
Review your favorite Linux distribution.
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 06-05-2016, 10:13 AM   #1
edcelvista24
LQ Newbie
 
Registered: Apr 2016
Posts: 8

Rep: Reputation: Disabled
Proper Routing Linux [CORRECT ME]


tun0
Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.11.0.58 P-t-P:10.11.0.57 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:682 (682.0 b) TX bytes:698 (698.0 b)

/////////////////////////////////////////////////////////////////////////////////
sudo ip route add 10.11.1.0/24 dev eth0 src 10.11.1.138 table tun0
sudo ip route add default via 10.11.1.137 dev tun0 table tun0
sudo ip rule add from 10.11.1.137/24 table tun0
sudo ip rule add to 10.11.1.137/24 table tun0
 
Old 06-05-2016, 02:53 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,465

Rep: Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936Reputation: 7936
Quote:
Originally Posted by edcelvista24 View Post
tun0
Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.11.0.58 P-t-P:10.11.0.57 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:682 (682.0 b) TX bytes:698 (698.0 b)

/////////////////////////////////////////////////////////////////////////////////
sudo ip route add 10.11.1.0/24 dev eth0 src 10.11.1.138 table tun0
sudo ip route add default via 10.11.1.137 dev tun0 table tun0
sudo ip rule add from 10.11.1.137/24 table tun0
sudo ip rule add to 10.11.1.137/24 table tun0
Is there a question/problem in there somewhere????

Read the "Question Guidelines" link in my posting signature. You are not providing ANY useful details at all...version/distro of Linux, hardware, or even what your actual goal is, what you're trying to do, and what environment you're in. Based on the post title, how are we supposed to know what's 'proper' for you? How can we correct you when you provide NO details at all, or even tell us what's wrong?
 
Old 06-05-2016, 04:43 PM   #3
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Normally this is all taken care of by the system. You can check your routing with:

Code:
route -n
 
Old 06-05-2016, 08:24 PM   #4
edcelvista24
LQ Newbie
 
Registered: Apr 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hello my problem is this.

sudo ip route add 10.11.1.0/24 dev eth0 src 10.11.1.138 table tun0
sudo ip route add default via 10.11.1.137 dev tun0 table tun0
sudo ip rule add from 10.11.1.137/24 table tun0
sudo ip rule add to 10.11.1.137/24 table tun0

Considering that the mask is 255.255.255.255. Is this correct 10.11.1.0/24 <<<< OR its should be 10.11.1.0/32?
The point is i need to specify to the route specifically on the gateway IP not IP range with slash.
How to point an IP range that points only by itself not to its Range

Here are the details
10.11.1.137 - Default GAteway
10.11.1.138 - inet IP
custom table - tun0
NIC name - tun0
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to set a correct routing OpenVPN Frydolin Linux - Networking 2 07-25-2015 02:15 PM
iptables output filter dropping packets before correct routing decision is made gmarthe Linux - Networking 0 03-06-2013 06:44 AM
Proper routing when setting up a WAP abibibo Linux - Wireless Networking 4 09-09-2008 08:21 AM
routing http traffic to the correct box on subnet nodine Linux - Security 1 07-15-2004 10:51 AM

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

All times are GMT -5. The time now is 01:49 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