Networking Forums

Networking Forums > Computer Networking > Linux Networking > Visible private IP

Reply
Thread Tools Display Modes

Visible private IP

 
 
VspaceG
Guest
Posts: n/a

 
      08-09-2007, 08:14 AM
Hi guys,

I have the following problem : I have a computer running linux with 3
network links and 3 IP addresses:

IPA on network A with private IP adresses
IPB on network B
IPInternet on Internet

Linux is masquerading network A and routing network B. All is correct.

But I can ping IPA from network B. And IPA is responding. Is this a
known bug ?

Is ther some "ip rule" or "ip route" tricks to prevent this ? I want
to install private services on IPA, but I can connect to IPA.

Tanks,

 
Reply With Quote
 
 
 
 
Pascal Hambourg
Guest
Posts: n/a

 
      08-09-2007, 10:09 AM
Hello,

VspaceG a écrit :
>
> I have the following problem : I have a computer running linux with 3
> network links and 3 IP addresses:
>
> IPA on network A with private IP adresses
> IPB on network B
> IPInternet on Internet
>
> Linux is masquerading network A and routing network B. All is correct.
>
> But I can ping IPA from network B. And IPA is responding. Is this a
> known bug ?


No, it is a feature. By default a Linux box accepts traffic to any of
its local address on any interface, even when the destination address
does not match the input interface. And it can send traffic from any of
its local address on any interface, even when the source address does
not match the output interface. IIRC it is called "weak model".

"Worse" : from network B you should be able to ping any host in network
A. Remember that NAT itself does not provide a protection.

> Is ther some "ip rule" or "ip route" tricks to prevent this ?


I'm afraid no. Although it is possible to create source address-based
rules with the "unreachable" or "prohibit" type, e.g. :

ip rule add type unreachable to <network_a> from <network_b>

this would work only for packets sent from network B to network A
addresses other than IPA because the local routing table which contains
the local addresses (IPA, IPB, IPInternet, 127.0.0.0/8) is looked up
first before other routing rules are examined by the routing process.

Besides, this would prevent communications from network A to network B
from getting replies, which may be undesirable. One solution is to use
ACLs in the server application itself or in (x)inetd, tcpd, or any other
applicable wrapper. Another solution is to use iptables filtering rules
with connection tracking to reject NEW connections from network B to
network A and IPA. For example :

iptables -A FORWARD -s <network_b> -d <network_a> -m state --state NEW \
-j REJECT
iptables -A INPUT -s <network_b> -d <ipa> -m state --state NEW -j REJECT

Feel free to add more checks such as the input interface.
 
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
NFS Mounts not visible Ignoramus14968 Linux Networking 5 03-10-2008 05:44 PM
Masquerading private LAN to private ip entpneur@gmail.com Linux Networking 1 12-31-2007 02:39 AM
wireless network not visible =?Utf-8?B?Ymlyb2w=?= Broadband Hardware 1 10-29-2005 12:30 AM
Server Slow - No visible cause Chris V. Windows Networking 2 12-17-2004 03:46 PM
DFS not visible Mike Robertson Windows Networking 0 08-25-2003 07:57 PM



1 2 3 4 5 6 7 8 9 10 11