You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Question regarding use of nano in Terminal ^

Hello!


I'm on macOS Catalina 10.15.1and trying to run Nano 2.0.6.


I have a rather simple question.


I'm trying to edit the /etc/sysctl.conf file through Terminal, but as an almost completely inexperienced Terminal user (so don't be mean and use baby language please), I can't figure out how to actually navigate nano. It's telling me I can read by pressing "^R". Okay. I type down the actual ^ key on the keyboard and R and press enter, nothing happens. I try to hold the up-key and press R and vice versa and press enter, nothing happens.


I realise users of Terminal and nano revels in the pride of using such tools that are extremely user-unfriendly and difficult to navigate for the uninitiated, so don't bully me, but please give me some basic advice on how to proceed.


I wish to simply locate net.inet.ip.forwarding=1 and ensure it's 1 and not 0.


Grateful for help!


Best

iMac 21.5", macOS 10.15

Posted on Dec 6, 2019 7:19 AM

Reply

Similar questions

9 replies

Dec 8, 2019 1:41 PM in response to Simsalabing

If you are just checking on values within a configuration file and you are not familiar or aware of the commands to check the specific values as @etresoft mentions, then using the "less" command is safer than using "nano" since you could accidentally edit the file you are viewing if you are not careful. With "less" you can use the arrow keys to scroll up & down within the file line by line or use the Page Up/Dn keys to scroll a page/window at a time, or the Home/End keys to scroll to the top or bottom of the file.

less  /etc/sysctl.conf


Starting with macOS Catalina many system files are stored on a read-only volume so you may not be able to edit them directly. If Apple expects certain system configuration files to be modified they will be located on a writeable volume, but I'm not sure how Catalina handles these situations when you want to manually edit a system configuration file. Instead it may be easier & safer to use the specific macOS system commands such as the one suggested by @etresoft.


If you modify a system configuration file, you should always back it up first just in case something goes wrong. It is so easy to make a mistake and sometimes the mistake can be so subtle that you will have a hard time even noticing the mistake. This is true no matter how experienced a person is with the command line.

Dec 8, 2019 7:49 PM in response to Simsalabing

This may not be a simple question, any familiarity with nano or less/more or other commands aside... What problem are you working toward solving with this current approach? Not how are you solving it with nano, but what is the more general issue or problem that you are seeking to address with the NAT forwarding settint?


macOS generally makes an expensive and problematic router, and NAT is whole buckets of fun, but that’s hopefully all fodder for another time and you can (hopefully) avoid using a Mac as a router...


Here? Use the sysctl command.


View:

sysctl net.inet.ip.forwarding


Change:

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


I don’t, however, have a Catalina system handy to check.


Question regarding use of nano in Terminal ^

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