Solved

Multiple IP addresses

Posted on 2000-05-12
9
179 Views
Last Modified: 2010-03-18
My requirement is to simulate a scenario
in which 2 machines are connected via
gateways accross an insecure network.

   A --G1--<insecure net>--G2-- B

But the problem is that I have only two machines
available. One of them has 2 network cards which
I would be using to simulate the '2 gateways across
the net' (G1 and G2). But the other machine has just one network
card, but I would like to simulate it as the 2 'end-point'
machines (A and B).
So I tried cloning the eth0 (having address for A) with a different
IP address (for B, for a different subnet) and tried to
route the packets through the 'gateway' to the 'other' IP
address ('B') but apparently the kernel (or whatever) detects
that the 'remote' address is of the same host and the
packets are never transferred through the network card -
they are simply looped back.

Is it possible to configure the 'end-point' machine
such that it cannot detect it's own 'other' IP address
and is forced to route the packet to the specified
gateway ?
0
Comment
Question by:avinashb050800
  • 4
  • 3
  • 2
9 Comments
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
I don't think so, given the way routing works. But, with only two machines you can't actually simulate your scenario. Network traffic over the "insecure network" will only be between the two "gateways" because they have direct routes to each other. So it really doesn't matter if you have one or two NIC's in each box.

You'd need a minimum of four systems to set up the scenario for any realistic testing (but you probably already know that). If the goal is work with mechanisms for transport over insecure networks (encrypted tunnels and the like) you can work that part of the problem with just two systems, each with a single NIC. The routing issues can't be examined without the presence of the gateway boxes.
0
 

Author Comment

by:avinashb050800
Comment Utility
Thanks Jlevie for your comment - but let me put my question in a sharper focus.

If I have a machine with 2 IP addresses and only 1 NIC, is possible to route the packets between them through an external gateway ?

I tried modifying the routing tables to affect that but the packets never reach the NIC. Apparently at some stage the IP detects that the destination address is 'local' ...

Avinash
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Could you give a specific example of how you've configured the IP's?
0
 
LVL 6

Expert Comment

by:Portang
Comment Utility
Looks like you're trying to implement a VPN. IP tunneling could be a solution to your scenario. In which case private packets are encapsulated and forwarded by way of public, insecure connection.
You need to configure the Linux kernels to support these features on both end stations. Of course I'm just point out this direction. If this suite your situation, you'd want step-by-step instructions and more detailed documentation on how to configure the interfaces.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:avinashb050800
Comment Utility
I have cloned my eth0 so I now have
-->eth0 with IP addr 192.9.201.100
-->eth0:0 with IP addr 192.9.205.7

and in the routing tables I have added
Dest          gw             Iface
192.9.205.0   192.9.201.74   eth0

The configuraration works for all '205.*' bound packets except for '205.7'.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
Comment Utility
Well of course. 192.9.205.7 is, by definition, the local machine and the routing engine knows that. From a routing standpoint it has no need to forward the packet anywhere else as the packet is already at its final destination. The system will, as you've observed, quite happily route data out eth0:0 for any other IP in 192.9.205.0.
0
 
LVL 6

Expert Comment

by:Portang
Comment Utility
I suppose the insecure connection that  A has now is eth0 (192.9.201.100) through GW1 (192.9.201.74) to the other end point B.
Now what you want to accomplish is establish an end-to-end 192.9.205.0 connection through the above link, am I right?  If this is what you have in mind, then continue...
The IP-IP, or IP tunneling which implements the GRE, generic routing protocol, is what you need.
In your case, it's not necessary to have two physical network interfaces in each endpoint. You create and configure a (pseudo, virtual...) tunnel interface for 192.9.205.7 on A, also similar on endpoint B.  The kernel, IP protocol stack, will encapsulate these 192.9.205.0 packets with 192.9.201.0 headers so that they can be forwarded through the default gateway. On the other endpoint, the kernel of course will take care of the decapsulation.
Different venders have different implementation. Here we have Linux, right?
0
 

Author Comment

by:avinashb050800
Comment Utility
I guess jlevie, you've got a point. I would need a reeeeal low level tweaking in the kernel to manage this (route.c ?)...
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Ummm, yeah I think that would require major surgery of the kernel's routing engine.

You really need more than two systems to do this. As I think that you are trying to play with encrypted VPNs you'd want four to fully simulate the scenario. However, if you don't have that you could come pretty close by simply treating the link between the two boxes as the insecure network and running the VPN over that. If you think each of the nodes as an encrypting "gateway", it doesn't really make much difference to the box whether the traffic originates from within the box or from a second NIC. Presumably the routing engine is taking care of where the traffic originated and when it's time to encrypt it and pass it out over the link the traffic has effectively become "local".
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now