Networking Forums

Networking Forums > Computer Networking > Linux Networking > Handling multiple equal network addresses

Reply
Thread Tools Display Modes

Handling multiple equal network addresses

 
 
Dirk Stöcker
Guest
Posts: n/a

 
      06-19-2009, 10:58 AM
Hello,

I have a little bit complicated problem and would be glad if anyone can
give me some hints how to solve it:

I have multiplexe serial device which establish a ppp connection to a
linux box. All these devices use the same IP 192.168.0.32. Now my problem
is how I can setup my computer so, that I'm able to access all these
device same time:

- Modifying routing tables
- Setting up packet filtering with iptables
- ...

Best would be, if a static set of rules could be used, so that I can
map device on ppp0 to 10.0.1.1 and device on ppp1 to 10.0.2.1 and so on.

I did some testing using iptables but till know did not really have any
success.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)
 
Reply With Quote
 
 
 
 
terryc
Guest
Posts: n/a

 
      06-19-2009, 03:56 PM
On Fri, 19 Jun 2009 12:58:23 +0200, Dirk Stöcker wrote:

> Hello,
>
> I have a little bit complicated problem and would be glad if anyone can
> give me some hints how to solve it:
>
> I have multiplexe serial device which establish a ppp connection to a
> linux box. All these devices use the same IP 192.168.0.32. Now my
> problem is how I can setup my computer so, that I'm able to access all
> these device same time:


Could you rephrase that so we are clear as to what you are doing?

There was an old linux application that allowed you to combine multiplex
serial/modem links to share the load and thus increase the throughput.

the software amalgamated the multiple links so that it appeared as one
ppp device.

Is this what you want?
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      06-19-2009, 07:56 PM
Hello,

Dirk Stöcker a écrit :
>
> I have multiplexe serial device which establish a ppp connection to a
> linux box. All these devices use the same IP 192.168.0.32. Now my
> problem is how I can setup my computer so, that I'm able to access all
> these device same time:
>
> - Modifying routing tables
> - Setting up packet filtering with iptables
> - ...
>
> Best would be, if a static set of rules could be used, so that I can map
> device on ppp0 to 10.0.1.1 and device on ppp1 to 10.0.2.1 and so on.


You'll need iptables and advanced routing (iproute).

1) For each interface ppp$n, extract n.

2) With iptables, MARK packets to 10.0.$[$n+1].1 with mark $[$n+1] and
DNAT them to 192.168.0.32.

iptables -t mangle -A OUTPUT -d 10.0.$[$n+1].1 -j MARK --set-mark $[$n+1]
iptables -t nat -A OUTPUT -d 10.0.$[$n+1].1 -j DNAT --to 192.168.0.32

3) With iproute, route packets with mark $[n+1] via ppp$n.

ip rule add fwmark $n lookup $[100+$n]
ip route add default dev ppp$[$n-1] table $[100+$n]

All but the "ip route" command can be "preloaded" before ppp interfaces
come up. The "ip route" command can be automatically run when the
related ppp interface comes up by /etc/ppp/ip-up or a script in
/etc/ppp/ip-up.d/. The route is automatically deleted when the related
interface comes down
 
Reply With Quote
 
Dirk Stöcker
Guest
Posts: n/a

 
      06-23-2009, 08:47 AM
On Fri, 19 Jun 2009, Pascal Hambourg wrote:

>> I have multiplexe serial device which establish a ppp connection to a
>> linux box. All these devices use the same IP 192.168.0.32. Now my problem
>> is how I can setup my computer so, that I'm able to access all these
>> device same time:
>>
>> - Modifying routing tables
>> - Setting up packet filtering with iptables
>> - ...
>>
>> Best would be, if a static set of rules could be used, so that I can map
>> device on ppp0 to 10.0.1.1 and device on ppp1 to 10.0.2.1 and so on.

>
> You'll need iptables and advanced routing (iproute).
>
> 1) For each interface ppp$n, extract n.
>
> 2) With iptables, MARK packets to 10.0.$[$n+1].1 with mark $[$n+1] and DNAT
> them to 192.168.0.32.
>
> iptables -t mangle -A OUTPUT -d 10.0.$[$n+1].1 -j MARK --set-mark $[$n+1]
> iptables -t nat -A OUTPUT -d 10.0.$[$n+1].1 -j DNAT --to 192.168.0.32
>
> 3) With iproute, route packets with mark $[n+1] via ppp$n.
>
> ip rule add fwmark $n lookup $[100+$n]
> ip route add default dev ppp$[$n-1] table $[100+$n]
>
> All but the "ip route" command can be "preloaded" before ppp interfaces come
> up. The "ip route" command can be automatically run when the related ppp
> interface comes up by /etc/ppp/ip-up or a script in /etc/ppp/ip-up.d/. The
> route is automatically deleted when the related interface comes down


Thanks a lot. I switched to using 10.0.0.1 for ppp0 (so the +1 and -1
vanish). Your description was nearly perfect, only the

iptables -t nat -A POSTROUTING -d 192.68.0.32 -j SNAT --to 192.168.0.1 was

missing, so the packets have correct source IP address.

You saved me a lot of work, as I think it would have taken some time until
I would have found the MARKing and the more complex ip route/ip rule
stuff.

Maybe I continue this to make the 10.0.x.x available from outside the box
as well, but this is trivial :-)

Ciao
--
http://www.dstoecker.eu/ (PGP key available)
 
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
Internet Sharing: Equal upload speeds but un-equal download speeds NJT Wireless Networks 2 09-15-2007 06:22 AM
Server 2003 obtaining multiple multiple IP addresses via DHCP pbrommer@gmail.com Windows Networking 1 03-29-2007 02:24 AM
Network Load Balancing and multiple IP addresses Sandy Ryan Windows Networking 0 12-21-2005 07:38 PM
Network with about 80 clients, 5 Static IP Addresses and multiple segments stan Network Routers 1 06-24-2005 12:55 AM
multiple IP addresses for same network device dave Broadband Hardware 3 12-28-2004 09:13 PM



1 2 3 4 5 6 7 8 9 10 11