Networking Forums

Networking Forums > Computer Networking > Linux Networking > Freeswan and loopback interface

Reply
Thread Tools Display Modes

Freeswan and loopback interface

 
 
Paolo
Guest
Posts: n/a

 
      05-05-2004, 02:43 PM
Hi all!

I'm trying to solve without success the following problem:

Scenario:

I've got a linux appliance behind an adsl router.
I user a private /30 to connect the router to the appliance
to save IP addresses. The router does only routing no nat.

| lo:1 public ip1 int adsl: public ip2
|----Linux appliance---------------ADSL router--------
| eth0:192.168.0.1 eth:192.168.0.2
private net 10.0.0.0/16

In this way I use only 2 pubblic IP addresses.
Don't tell me to use an ADSL interface on the appliance:
I can't.

Problem:

I want to set up a IPSec tunnel in between two appliance.

The problem is that I must use public ip1 as "right"
but freeswan cannot set routing because the nexthop is not
on the same net specified by lo:1 (that is by the way configured
with netmask 255.255.255.255)

it tries to add a route for the remote network in this way:
route add -net remote netmask remotemask dev ipsec0 gw 192.168.0.2

but it obviously fail because that is not correct
(I configured interface="ipsec0=lo:1")

Has anyone any suggestion?

Thanks!!
Paolo
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a

 
      05-06-2004, 04:40 AM
On 5 May 2004 07:43:25 -0700, Paolo <(E-Mail Removed)> wrote:
> Hi all!
>
> I'm trying to solve without success the following problem:
>
> Scenario:
>
> I've got a linux appliance behind an adsl router.
> I user a private /30 to connect the router to the appliance
> to save IP addresses. The router does only routing no nat.
>
>| lo:1 public ip1 int adsl: public ip2
>|----Linux appliance---------------ADSL router--------
>| eth0:192.168.0.1 eth:192.168.0.2
> private net 10.0.0.0/16
>
> In this way I use only 2 pubblic IP addresses.
> Don't tell me to use an ADSL interface on the appliance:
> I can't.
>
> Problem:
>
> I want to set up a IPSec tunnel in between two appliance.
>
> The problem is that I must use public ip1 as "right"
> but freeswan cannot set routing because the nexthop is not
> on the same net specified by lo:1 (that is by the way configured
> with netmask 255.255.255.255)


I do not understand how you can have a public IP on a "lo" (loopback)
interface, since that just loops back to you.

> it tries to add a route for the remote network in this way:
> route add -net remote netmask remotemask dev ipsec0 gw 192.168.0.2


Probably because that (default route) is the only route available that
could lead to whatever you are attempting to connect to. I imagine you
should be using eth0:0 for public ip1 (assuming your router knows to route
that IP to you).

> but it obviously fail because that is not correct
> (I configured interface="ipsec0=lo:1")
>
> Has anyone any suggestion?


Ipsec has to tunnel over a real reachable route, and lo has no route out
of your box.

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Reply With Quote
 
Paolo
Guest
Posts: n/a

 
      05-09-2004, 01:30 PM
(E-Mail Removed) (David Efflandt) wrote in message news:<(E-Mail Removed)>...
> On 5 May 2004 07:43:25 -0700, Paolo <(E-Mail Removed)> wrote:
> > Hi all!
> >
> > I'm trying to solve without success the following problem:
> >
> > Scenario:
> >
> > I've got a linux appliance behind an adsl router.
> > I user a private /30 to connect the router to the appliance
> > to save IP addresses. The router does only routing no nat.
> >
> >| lo:1 public ip1 int adsl: public ip2
> >|----Linux appliance---------------ADSL router--------
> >| eth0:192.168.0.1 eth:192.168.0.2
> > private net 10.0.0.0/16
> >
> > In this way I use only 2 pubblic IP addresses.
> > Don't tell me to use an ADSL interface on the appliance:
> > I can't.
> >
> > Problem:
> >
> > I want to set up a IPSec tunnel in between two appliance.
> >
> > The problem is that I must use public ip1 as "right"
> > but freeswan cannot set routing because the nexthop is not
> > on the same net specified by lo:1 (that is by the way configured
> > with netmask 255.255.255.255)

>
> I do not understand how you can have a public IP on a "lo" (loopback)
> interface, since that just loops back to you.


It's a tecnique that is often used in routers. It helps you to make
your router reacheable indipendently of wich interfaces is active.
In fact as soon as your router/linux box gets a packet that match a
local ip (also on a loopback!) it consider it "local" traffic and
pass it to upper layer protocols...

> > it tries to add a route for the remote network in this way:
> > route add -net remote netmask remotemask dev ipsec0 gw 192.168.0.2

>
> Probably because that (default route) is the only route available that
> could lead to whatever you are attempting to connect to. I imagine you
> should be using eth0:0 for public ip1 (assuming your router knows to route
> that IP to you).


I've tried what you suggest. I doesn't work for the same reason.
I've assigned ip1 to eth0:0 with /32 netmask. The route command
fails once again because the gateway 192.168.0.2 is not on the same
network as the one implicitly defined by eth0:0 (ip1/32).

Argh!!!

Thanks for your help
Paolo

> > but it obviously fail because that is not correct
> > (I configured interface="ipsec0=lo:1")
> >
> > Has anyone any suggestion?

>
> Ipsec has to tunnel over a real reachable route, and lo has no route out
> of your box.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loopback interface mbm Linux Networking 0 02-06-2008 09:21 AM
Changing the Source IP on a Loopback Interface Jason Timmins Windows Networking 0 02-23-2007 02:57 PM
MS TCP Loopback Interface Jag Windows Networking 2 05-25-2006 09:50 PM
Problem with TCP connection over loopback interface Prasanna Krishnamoorthy Linux Networking 0 05-17-2005 11:33 AM
SIOCGIFFLAGS fails loopback interface Alexandros Karypidis Linux Networking 1 07-14-2004 04:57 PM



1 2 3 4 5 6 7 8 9 10 11