Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Turn you Mac into a super router

Hello,


I searched and found that it is possible to turn your Mac into a router. You might have old Mac computers. How about set it up as a router? By this, you can do some research and experiment on that Mac computer, which is really challenging and interesting.


macOS has another name: Unix. It's not Unix-like, such as Linux, etc. It's really a certified Unix. And Unix's most apparent characteristics is that you can do everything by the CLI (command line). Mac has a nice GUI (graphic user interface), but it also has a power CLI - the Terminal.


You guys might ask why a Mac could be turned into a router? What's the basic rationale? To explain this is simple. In the System Preferences > Sharing, there is an option called Internet Sharing. It is right this Internet Sharing that turns your Mac into a router. So it is possible to achieve this goal on Mac in theory. Below I will tell how to enable this function by CLI.


First, you have to run this command to turn on the routing function, also known as packet forwarding function.

sysctl -w net.inet.ip.forwarding=1


However, this would lose function after you reboot your Mac. To enable it on booting, create a file via PICO editor:

/private/etc/sysctl.conf


and write a line:

net.inet.ip.forwarding=1


Done. Now you Mac becomes a router.

Posted on Sep 4, 2018 11:45 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 13, 2018 9:19 AM

Hello, I have checked the article. And some of the functions, like NetInstall, are built-in in Mojave. See below. So I wonder if these function could be managed by the new Mac server app for Mojave? They are built-in, you don't even need to install them, they are just there.


User uploaded file

11 replies

Sep 6, 2018 10:01 AM in response to TomHsiung

Be aware that all the networking services provided by

macOS Server app are going to be deprecated and you will need

to use other alternatives for most all of the network services.


See here for all the upcoming changes:

Prepare for changes to macOS Server - Apple Support


Based on all of these changes, Linux will be much easier to manage as

server than macOS will.

Sep 6, 2018 8:58 AM in response to BobTheFisherman

No. macOS has built-in ability to run as a server. OS X is derived from BSD, a well known version of Unix system. Linux was created later, and it's a Unix-like system.


As a server operation system, macOS is very stable. Basic Unix CLI syntax for macOS is as the same as for Unix, BSD, or Linux. The most advantage of macOS as a server operation system is that it is a commercial operation system. Beside, macOS server app could be run on client Mac computers and server administrator can configure the Mac server remotely. In addition, macOS server app provides some functions that Linux can't, for example, the NetInstall service, the network time machine service. Also, many service function could be set up and configured via macOS server app, which is friendly to new server administrators.


Most server version Linux only provides CLI user interface. However, macOS provides both CLI and graphic user interfaces.


The biggest disadvantage of Mac as server is its price. To use macOS, you must get a Mac computer. The price is high.

Sep 6, 2018 12:11 PM in response to TomHsiung

Apple has been stripping things out of Server some time now.

Whether there will even be a Server app in the future would be

a good question with what little remains in it.


But I do agree with others here in terms of a router. Routers are

specifically designed both in firmware and hardware to deal with

all the tasks that a router does which makes them much more efficient

at those tasks, i.e. faster than a Mac could.

Sep 7, 2018 7:26 AM in response to TomHsiung

If you are learning learn this, you are headed down the wrong path. Learn using the proper tool for the job. Learn that MacOS is not a server operating system like Linux. If it were most of the Internet servers would be running MacOS rather than a variation of Linux. Learn that there are headless servers for a reason. Learn that Linux can use multiple desktops and GUI. Your understanding of servers appears limited. Learn before advocating for the use of the wrong tool (MacOS as a server, and a computer as a router).

Turn you Mac into a super router

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.