restricting private services to specific interfaces on server

restricting private services to specific interfaces on server

Post by Glen Coate » Tue, 20 Aug 2002 23:15:51



I've got a 3 machine network, and I am far from a competent sysadmin.
I'd like to restrict certain services (such as RPC and printer services)
to specific network interfaces.  Any help would really be appreciated.

One machine (tycho) has a cable modem connection to the net, and is the
NFS/NIS/DHCP server to the other two machines (jake & elwood).  On tycho,
eth0 is the cable modem, eth1 is a crossover cable to elwood, and eth2 is
a crossover cable to jake.  This is the current output from an nmap on
tycho's public IP (eth0), run from elwood:

Port       State       Service
22/tcp     open        ssh                    
111/tcp    open        sunrpc                  
139/tcp    open        netbios-ssn            
515/tcp    open        printer                
600/tcp    open        ipcserver              
617/tcp    open        unknown                
658/tcp    open        unknown                
758/tcp    open        nlogin                  

Ideally, I'd like these ports to only be open to eth[12], and I'd like
outside connections to only be able to see an open port 22 for ssh
connections.

How can I achieve this?  Is there some general way to do it for all
services, or do I need to tackle this on a service-by-service basis?

--
Cheers,
Glen

 
 
 

restricting private services to specific interfaces on server

Post by Nils O. Sel?sd » Tue, 20 Aug 2002 23:21:59


Quote:> I've got a 3 machine network, and I am far from a competent sysadmin.
> I'd like to restrict certain services (such as RPC and printer services)
> to specific network interfaces.  Any help would really be appreciated.

> One machine (tycho) has a cable modem connection to the net, and is the
> NFS/NIS/DHCP server to the other two machines (jake & elwood).  On tycho,
> eth0 is the cable modem, eth1 is a crossover cable to elwood, and eth2 is
> a crossover cable to jake.  This is the current output from an nmap on
> tycho's public IP (eth0), run from elwood:

> Port       State       Service
> 22/tcp     open        ssh                    
> 111/tcp    open        sunrpc                  
> 139/tcp    open        netbios-ssn            
> 515/tcp    open        printer                
> 600/tcp    open        ipcserver              
> 617/tcp    open        unknown                
> 658/tcp    open        unknown                
> 758/tcp    open        nlogin                  

> Ideally, I'd like these ports to only be open to eth[12], and I'd like
> outside connections to only be able to see an open port 22 for ssh
> connections.

> How can I achieve this?  Is there some general way to do it for all
> services, or do I need to tackle this on a service-by-service basis?

No general way, you have to read the docs/manpages for each service and
see how you configure it(if you can at all)
Alternativly, put a firewall rule that blocks that port on the specific
interface.

 
 
 

restricting private services to specific interfaces on server

Post by Jeroen Geilma » Thu, 22 Aug 2002 23:40:45




Quote:> I've got a 3 machine network, and I am far from a competent sysadmin.
> I'd like to restrict certain services (such as RPC and printer services)
> to specific network interfaces.  Any help would really be appreciated.

> One machine (tycho) has a cable modem connection to the net, and is the
> NFS/NIS/DHCP server to the other two machines (jake & elwood).  On tycho,
> eth0 is the cable modem, eth1 is a crossover cable to elwood, and eth2 is
> a crossover cable to jake.  This is the current output from an nmap on
> tycho's public IP (eth0), run from elwood:

> Port       State       Service
> 22/tcp     open        ssh
> 111/tcp    open        sunrpc
> 139/tcp    open        netbios-ssn
> 515/tcp    open        printer
> 600/tcp    open        ipcserver
> 617/tcp    open        unknown
> 658/tcp    open        unknown
> 758/tcp    open        nlogin

> Ideally, I'd like these ports to only be open to eth[12], and I'd like
> outside connections to only be able to see an open port 22 for ssh
> connections.

Okay, for one - you can't see what ports are open on the outside interface
from within your network.
Any and all firewall rules / port forwarding etc. throw the results out the
window.
You can simply run nmap on the external machine - that will give you a clear
answer.

Basically, ANY service which runs from (x)inet.d , i.e. the internet
superserver, looks to the /etc/hosts.allow and /etc/hosts.deny files for
info on allowable networks and hosts.

"man hosts.allow" to find out how this can be applied to all services or to
individual services - it's quite flexible.

Windows networking ( the netbios-ssn port you have open - BAD idea) is
controlled by samba; "man smb.conf" for info on how to restrict this to one
or more interfaces.

Quote:

> How can I achieve this?  Is there some general way to do it for all
> services, or do I need to tackle this on a service-by-service basis?

Oops - seems I was a bit early...

As stated - it depends on the services involved.

 
 
 

1. Restricting network interfaces to superuser and/or specific gids/uids?

Has anyone tried to patch the kernel to restrict certain network
interfaces to a group or superuser? I.e., only let root bind to IP
aliases (eth0:0, etc).

Or maybe even force the default eth device to be another than eth0, so
that a certain group only can bind to, for example, eth0:0.

 . -+ Rasmus

Moving Pictures   --- telefon: 08 - 660 68 35
Sibyllegatan 79   --- telefax: 08 - 660 68 64
114 43 Stockholm  --- http://www.scenen.com

2. having problem in installing licq

3. FTP server, how to restrict access to one specific directory

4. Graphics Driver for #9

5. Restricting Sunray kiosk mode to specific servers?

6. Help needed with Alpha Linux networking ...

7. Interface-specific firewall rules with interface aliases

8. what is a parse error?

9. list of restricted and private use addresses

10. how to restrict maximum login attempts for a restricted website in apache server

11. restricting access to a specific URL

12. Question: IPROUTES2 Multiple default routes restricted to specific NICs

13. restricting user homepages to specific virtual host