Lunarhotel.co.uk

How about a view of the sea of tranquility?
Home Linux stuff Part 2: Inbound routing with two internet connections
E-mail
Print
PDF
Written by Web Master   
Friday, 28 August 2009 14:47
User Rating: / 0
PoorBest 
Article Index
Part 2: Inbound routing with two internet connections
Setting up the routing tables
Forwarding to other servers on the network
All Pages

This is part two of "Inbound and outbound routing over multiple internet connections " Any self respecting router not only routes traffic outwards, but of course allows certain services to be hosted and accessed by the "outside" In the case of routers with a single connection, this is fairly simple, but with two internet connections, it gets a bit more complex.


If the service you are hosting is running on the router itself, its quite simple to solve with some additional routing table rules. If however, the service is hosted on another server, then there needs to be some ip rules set in place to handle the request.

So lets tackle these in turn. Im assuming you read the first part of this guide ( Inbound and outbound routing over multiple internet connections ) because its going to build on what we've covered already.

We should already have a single script that does the following:

  1. Uses IPTABLES to setup the pc as a router and firewall
  2. Copies the main (and default) routing table to another table called tbr (which uses a secondary internet connection as its default)
  3. Uses IPTABLES to tag traffic of a certain type
  4. Defines IP rules to route packets that have been marked over the tbr table


We need to define some tables that cope with what happens when an incoming request it received. Requests coming in on the default connection (internet connection a) should be serviced no problem. Incomming requests coming in on internet connection b however will not be serviced. This is because the request will be recieved, a response sent, but it will send the response by the default connection (interent connection A) the ISP router will probably get it, and discard it because its unknown traffic. So what we need is two tables, one with interent connection a is the default, and another where internet connection b is the default, and some rules to decide when to use them. In theory, we could use the existing Main and tbr tables, but for good orders sake (and that of my sanity) I decided to create two new routing tables. So lets call them inboundA and inboundB.

  • InboundA has internet connection A as its default
  • InboundB has internet connection B as its default


Before we add these tables, we going to need to assemble some information, namely:

  • The name of the interface for each internet connection
  • The ip address of the router (the pc we're working on) as the adsl modem sees
  • The ip address range between the router (the pc we're working on) and the adsl modem
  • The public ip address of the connection


Last Updated on Wednesday, 09 September 2009 11:06
 

You must register if you wish to comment

Its official! usernames suck!

12507Check out the 10 mile round trip I had to do to login into a site that was asking for a username and password

Whos online

We have 2 guests online

Joomla EmailAsUsername Testamonials

"Thanks for a great plugin, and speedy helpful support."

"I really appreciate how responsive you have been and I want to reward you by adding a very positive comment on the Joomla site where I found your great plugin"

"Wow, tested it out and works like a champ"

"I had a couple of installation issues which Dylan sorted for me the same afternoon. Superb service for the price."

"Thank you!!!  Best support I have ever had!"

"Thank you soooooo much for your time and effort on this, you're a life saver!....If your ever in the London or Guildford area I'll get the beers in!"