LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-20-2015, 09:36 AM   #1
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Route Setup


So I have run into a weird setup that I could use help. I have a linux server with eth0 having 192.168.12.2 plugged into lan 1 on a switch with IP of 192.168.12.1. eth1 is 192.168.13.2 plugged into switch port 2 with IP of 192.168.13.1 . This is a layer 3 switch. I then have two other vlans 192.168.14.x and 192.168.15.x with servers on each.

The goal is to make it so that I can consolidate mail servers into one server and not have to reconfigure 230 linux servers to point to a single ip. They can continue to use the old server ip's that they were using before. Phase 1 upgrade the OS. Phase 2 touch all servers and send them to a single IP and remove the need for two ip address on the mail server.

The problem is that I have a default gateway for all traffic going to eth1. So when one of my servers attempts to get mail on 192.168.12.2 the traffic goes out eth1 instead of going out eht0 which is where the traffic came in on. If I remove the default traffic neither communication stops. the big problem is that the servers can reach both IP's on the mail servers.

Any help this you could give would be helpful.
 
Old 03-20-2015, 10:15 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Original Poster
Rep: Reputation: 102Reputation: 102
Ok I have found the solution. First make sure you have iproute2 or iproute installed. (I was using Scientific Linux 6.5 and it was already there). Then I did the following

Code:
echo "1 test" >> /etc/iproute2/rt_tables
ip route add 192.168.13.0/24 dev eth1 src 192.168.13.2 table test
ip route add default via 192.168.13.1 dev eth1 table test

ip rule add from 192.168.13.0/24 table test
ip rule add to 192.168.13.0/24 table test

ip route flush cache
basically you are creating routing policies. I hope this helps someone else having this issue.
 
  


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
setup pptp client that does not change default route markotitel Linux - Networking 1 02-28-2014 09:59 AM
Any way to setup multicast to route out 2 different network interfaces? mav1c Red Hat 1 08-15-2013 09:52 PM
[SOLVED] Two NIC Setup - Unable to route via one of them. compix Linux - Networking 4 04-30-2013 05:19 PM
How do I setup Multi-Path route iptables MikeyCarter Linux - Networking 1 06-14-2010 03:28 PM
nfs setup on slack 9.1 - no route to host daceo Slackware 2 02-19-2004 05:04 PM

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

All times are GMT -5. The time now is 05:43 AM.

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