How to config OS X File Sharing to bind to the second interface?

1

I have two interfaces:

  1. Wifi for the internet
  2. Ethernet for office intranet

When I enable File Sharing, it defaults to share on the first interface. Is it possible to share on the second interface?

ohho

Posted 2011-11-10T03:25:25.283

Reputation: 2 356

Answers

2

The share is available to all interfaces by default.

While System Preferences will only list one IP address in sharing, the share is available on all interfaces as it is a resource of your machine, accessible to any valid request from either interface.

To test the theory, with AFP sharing ON, go into Finder, Go > Connect to Server... and attempt to connect to:

afp://ip.address.for.interface.1

You should get:

There was a problem connecting to the server "ip.address.for.interface.1". The file server is available on your computer. Access the files locally.

Now try with the IP of your second interface,

afp://ip.address.for.interface.2

Same error.

Ron Casey

Posted 2011-11-10T03:25:25.283

Reputation: 36

Hello, thanks for the clarifications, I have a question, how can I do to bind file sharing only on one specific network interface ? Thanks – Alfonso Tesauro – 2019-09-29T12:27:08.377

I am using SMB for sharing, does that make it difference? – ohho – 2011-11-11T02:12:03.963

If you're using 10.6 or earlier check out Using multiple network interfaces (NICs) with Samba and Unleash the Power of Samba Under OS X.

If 10.7 Samba needs to be installed manually to edit conf: OSX Lion Samba SMB shares

– Ron Casey – 2011-11-11T12:09:22.707

Keep in mind if you setup a custom install of Samba under 10.7 you'll need to turn off SMB sharing in system preferences and create your own shares. In 10.6 and lower follow the directions in the first article to allow sharing over multiple NICs. The second article contains all the information you need to translate the instructions from FreeBSD to OS X. – Ron Casey – 2011-11-11T12:17:12.947