No Nat problem

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello... 

I have the following problem: 

The usual way for a linux router to manage connections between 2 or more internet providers and an internal network is to SNAT the internal network into the (usually 1) external ip address that the provider has given us. My problem is that i dont wish to do SNAT (anymore) because my provider has given my a unique internet ip address for each pc so that my the internet address and local are identical. My SNAT configuration worked perfectly. I had two routing tables

1)Main
231.245.21.0/27 dev eth2  scope link 
192.168.1.0/24 dev eth0  scope link 
192.168.2.0/24 dev eth1  scope link 
default via 192.168.1.1 dev eth0

2)Policy
231.245.21.0/27 dev eth2  scope link 
192.168.1.0/24 dev eth0  scope link 
192.168.2.0/24 dev eth1  scope link 
default via 231.245.21.1 dev eth2

Where 192.168.2.0 is my internal network, 231.245.21.0 the network of Provider 1 and 192.168.1.0 the network of Provider 2.It all worked (almost) flawlessly. Certain Ports were going out from eth2 while all the other from eth0.

One would say that with the internet ips i would have to make the following change: (Asuming that pc's at lan have 231.245.21.4-62 from now on)

1)Main
231.245.21.0/27 dev eth2  scope link 
231.245.21.0/27 dev eth0  scope link 
192.168.1.0/24 dev eth1  scope link 
default via 192.168.1.1 dev eth2

and

2)Policy
231.245.21.0/27 dev eth2  scope link 
231.245.21.0/27 dev eth0  scope link 
192.168.1.0/24 dev eth1  scope link 
default via 231.245.21.1 dev eth2

But alas, when i tried to do that it was not accepted: 
"RTNETLINK : File exists" <--- exit output
I tried to do it with the route command and it was accepted only for main table but look what was happening. If i had the first declaration of the subnet
in eth2 I could only communicate with the gateway 1 (231.245.21.1) while if it was eth0 in the first declaration I couldn' t communicate with the gw but only with lan. Then I tried another way. Instead of declaring the same network I declared a static route only with the gateway in eth2. Thus : 

1)Main
231.245.21.1 dev eth2  scope link 
231.245.21.0/27 dev eth0  scope link 
192.168.1.0/24 dev eth1  scope link 
default via 192.168.1.1 dev eth1

2)Policy
231.245.21.1 dev eth2  scope link 
231.245.21.0/27 dev eth0  scope link 
192.168.1.0/24 dev eth1  scope link 
default via 231.245.21.1 dev eth2

And in that way i managed into the point that i could communicate from my linux router with both sides. I mean Provider 1 and internal network. I could also communicate from my local lan with provider 2. But the real problem is that i cannot communicate with Provider 1 from my local lan. Is this the right way to accomplish that and i am missing something or is it the tottally wrong way to do it. Someone plz help.

                                 Thank you in advance

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux