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

Share internet from Ethernet 2 to Ethernet 1

Hello,


My Mac Pro is connected to a router by its Ethernet 2 port; I want to connect another computer (Linux) to Ethernet 1 (so the Linux computer can connect to the Internet passing by the Mac Pro). I can easily share the connection from Ethernet 2 to AirPort (e.g. to synchronise my iPhone) using the Sharing pane of System Preferences, but sharing from Ethernet 2 to Ethernet 1 does not work.

I tried several configurations; sometimes I can just ping from the Linux computer to the Mac Pro (Ethernet 1 address only), sometimes I can ping up to my home's router and other times I can't ping at all. With all the configurations I tried, Internet can't be reached, even when I can ping the router.


Searched on various forums, found no help.

How should I go for this?

Mac Pro, Mac OS X (10.6.8)

Posted on Feb 12, 2014 1:43 PM

Reply
29 replies

Feb 12, 2014 10:08 PM in response to Anic264b

You should be able to do this. The Mac will automatically create a simple DHCP Router and provide Network Address Translation, so just set your Linux system for DHCP Address. The range provided will not conflict with your existing local Network addresses.


For the Sharing port, the Address shown in System Preferences > Network > Ethernet ...


... will be a "self assigned" IP Address, in the range 169.254.xxx.yyy. You cannot use that for anything.


The Router address provided for the Linux system to use is likely to be something like 192.168.100.1



OS X Mavericks: Share your Internet connection


(This is not a new feature in Mavericks.)

Feb 13, 2014 1:01 AM in response to Grant Bennet-Alder

Thanks for your reply. As I said, I'm accustomed in sharing from Ethernet to Airport (it normally works), but from Ethernet 2 to Ethernet 1, it fails. I conclude there's an additional setting I'm missing.

You said to provide a "router address" for the Linux system. Is that the IP address that I should put for Ethernet 1 (the one connected to my Linux computer)?

Still about Ethernet 1, I think I don't know how exactly to configure it. I know what “Using DHCP” usually means (for connecting to a router), but in my case, is this option required to provide DHCP services (in other words, in order to make my Mac a DHCP server using Ethernet 1, should I configure Ethernet 1 also as “Using DHCP”)?

I also tried to set Ethernet 1 as “Manually”; I filled the IP Address to be “192.168.100.1” (not being sure it would apply to the router address for the Linux computer), but did not filled the other fields, except the subnet field which was automatically filled (and I agreed to it), With that configuration, I can ping 192.168.100.1 from my Linux computer, but 192.168.2.222 (my manually-assigned address for the working Ethernet 2) doesn't even work, so it seems like the connection doesn't go past the Mac Pro (is it just NAT not working?).

Can you provide a more precise setup, please?

Thanks

Feb 13, 2014 8:24 AM in response to Anic264b

Is that the IP address that I should put for Ethernet 1 (the one connected to my Linux computer)?

When you enable Internet Sharing on an Ethernet port, that port on your Mac automatically loads a bunch of software and becomes a Router, ready to act as agent for your Linux machine to the rest of the Network and beyond. If you know Networking, this is not intuitive. But this is the Apple way.


You are massively over-thinking your interventions and settings. Do not be distracted by any IP address you see for any of these ports -- the Mac simply makes it work for you. Ping your Hardware Router -- the rest is "magic".


Set the Linux machine to get its IP Address "via DHCP" (which will be provided by the Mac port doing the sharing).


After changing any Network settings, be sure to close the window and save changes -- they will not take effect until you do.

Feb 13, 2014 9:14 AM in response to Grant Bennet-Alder

Grant Bennet-Alder wrote:

When you enable Internet Sharing on an Ethernet port, that port on your Mac automatically loads a bunch of software and becomes a Router, ready to act as agent for your Linux machine to the rest of the Network and beyond. If you know Networking, this is not intuitive. But this is the Apple way.

Ok, I recoginse this when it works from Ethernet 2 to Airport. Again, from Ethernet 2 to Ethernet 1, I can't make it working, so there's a difference.

I learnt networking ten years ago, in some kind of “high school”, but I was oriented in programming; I'd say I know “half” the things (e.g. I forgot what a gateway is for).

You are massively over-thinking your interventions and settings. Do not be distracted by any IP address you see for any of these ports -- the Mac simply makes it work for you.

Well, I'm over-thinking this because it didn't worked the simple way.

Ping your Hardware Router -- the rest is "magic".

By Hardware Router, I guess you mean the “real” one that is not my Mac Pro, right?

If so, I don't understand how I can ping my hardware router if I can't even ping my Ethernet 2. To summarise:

Hardware Router (192.168.2.1)→Mac Pro (Ethernet 2 (192.168.2.222)) Mac Pro (Ethernet 1 (currently 192.168.100.1))→Linux (set by DHCP)

I can't ping 192.168.2.222 from the Linux computer, so I doubt to be able to ping 192.168.2.1 from Linux.

Set the Linux machine to get its IP Address "via DHCP" (which will be provided by the Mac port doing the sharing).

Of course, this is my first try. Only when this works I would assign a manual address. I'm suspecting the problem is rather in the Mac Pro.

After changing any Network settings, be sure to close the window and save changes -- they will not take effect until you do.

On my Linux computer, I've noticed this. Even after closing all the Networking windows, the “about” window for networking (not sure how it's named in English) still shows the previous settings; I have to restart Linux to get a new DHCP-assigned address (and I tried shell commands to renew the DHCP request).


Ok, let's start back at step 1: I share from Ethernet 2 to Ethernet 1, that's obvious. How should I configure Ethernet 1 (manually, using DHCP or BootP)?

Thanks

Feb 13, 2014 9:20 AM in response to mooblie

mooblie wrote:


Any reason you don't just plug the Linux PC directly into the router? (i.e. the "normal" solution - with a few advantages, like the Mac doesn't need to be on for the Linux PC to access the net.)

(first the short explanation) My Mac is always running (at least the Linux box won't run when the Mac is shut down), so that's not a problem.

Now, the reason I'm doing this is my router is (I'd say) 15 or 20 meters away from my Mac/room. I don't want to have two parallels cables (especially since I already have a Mac Pro with two Ethernet ports).

Feb 13, 2014 9:32 AM in response to Anic264b

Your use of Ethernet 1 to be shared, and Ethernet 2 to connect your Mac to the Internet makes me crazy.


But they SHOULD be interchangeable, so you should be able to use either one for either function.


When I think about WHY it might make me crazy, it reminds me of a fundamnetal rule: Your Mac will send packets bound for the Internet to the TOPMOST working interface listed in System preferences > Network. If you have not already demoted the port you intend to Share to the end of that list, you should do so now. Use the gear Icon.


------

How should I configure Ethernet 1 (manually, using DHCP or BootP)?

If Ethernet 1 is the port being shared to the Linux machine, you do not configure it AT ALL. If you have changed its settings, set it back to DHCP.


Anything you change Manually will mess up Sharing. You may even want to delete that port and Restart your Mac to get all pre-conceived notions removed.

Feb 13, 2014 1:57 PM in response to Anic264b

Anic264b wrote:


Now, the reason I'm doing this is my router is (I'd say) 15 or 20 meters away from my Mac/room. I don't want to have two parallels cables (especially since I already have a Mac Pro with two Ethernet ports).

How about running the single long cable into an ethernet switch, then separate short cables to the Mac Pro and the Linux machine? Even fast switches can be obtained inexpensively these days.

Feb 13, 2014 2:36 PM in response to Grant Bennet-Alder

Grant Bennet-Alder wrote:


Your use of Ethernet 1 to be shared, and Ethernet 2 to connect your Mac to the Internet makes me crazy.


But they SHOULD be interchangeable, so you should be able to use either one for either function.

This evening, I got an “amusing” surprise, which tends to mean it makes me crazy as well. Another computer on my network, which is pluged into the main router, could not connect to the Internet. I then tried to go to 192.168.2.1 (my router's IP), to look at its state, and instead Safari showed the HTML page of my web sharing of my Mac Pro. My Mac Pro had been temporarily my DHCP server instead of the usual one because I confused Ethernet 1 and Ethernet 2… Tired of trying too much, I guess.


So, well, I'll definitively use Ethernet 1 to connect to the Internet and Ethernet 2 to share it, so it's clearer.

When I think about WHY it might make me crazy, it reminds me of a fundamnetal rule: Your Mac will send packets bound for the Internet to the TOPMOST working interface listed in System preferences > Network. If you have not already demoted the port you intend to Share to the end of that list, you should do so now. Use the gear Icon.

In that list, Ethernet 2 seems to be the first one (unless it starts at end?). I have this, as it appears in the list of services:

Bluetooth PAN

DUN Bluetooth

AirPort

Ethernet 2

Ethernet 1

Firewire


I don't know what these Bluetooth have as differences, because I never used them. But it looks like Ethernet 2 is before Ethernet 1. Do you think I should put Ethernet 1 at the very top of the list (I don't recall why I put it in this order in the first place)?

If Ethernet 1 is the port being shared to the Linux machine, you do not configure it AT ALL. If you have changed its settings, set it back to DHCP.


Anything you change Manually will mess up Sharing. You may even want to delete that port and Restart your Mac to get all pre-conceived notions removed.

Ok, very nice to know, thank you!


So, now Ethernet 1 is connected to my home's Router and Ethernet 2 to the Linux computer. I did first set Ethernet 2 to DHCP, following your suggestion, but it assigned the 169 range of IP address; then I configured it as “DHCP with a manual address” (remember, I translate to English) and put 192.168.100.1 as the IP adress. From Linux (still using DHCP), I couldn't even ping 192.168.100.1.

Then, I chose to set 192.168.2.28 as Ethernet 2's IP (trying to put it in the same subnet as Ethernet 1). At that point, from the Linux box, I could connect to 192.168.2.28, 192.168.2.222 and even to my router (192.168.2.1), but pinging beyond the router (on the Internet) still fails and, of course, browsing doesn't work. But it's better.


I'd like to avoid restarting my Mac for now (I've a lot of applications open, in use). Is there anything else I should do now?

Thank you for your replies so far!

Feb 13, 2014 2:27 PM in response to markwmsn

markwmsn wrote:

How about running the single long cable into an ethernet switch, then separate short cables to the Mac Pro and the Linux machine? Even fast switches can be obtained inexpensively these days.

I guess it's both a matter of money and patience. I live in the middle of nothing and I “group” my travels. Also, as cheap as a switch can be, my house is already filled with tons of useless or working devices; I'd like to use what I already have (in other words, make this bridge between the two Ethernet ports, since it's said to be possible.

Of course, if there's really a big problem (e.g. my firmware is corrupted, or it's not possible in 10.6) and it's hopeless, I'd get one additional component.

Thanks for the suggestion.

Feb 13, 2014 2:44 PM in response to Anic264b

Anic264b wrote:

At that point, from the Linux box, I could connect to 192.168.2.28, 192.168.2.222 and even to my router (192.168.2.1), but pinging beyond the router (on the Internet) still fails and, of course, browsing doesn't work. But it's better.

Update (sorry, I can't edit my previous post): 192.168.2.1, from the Linux computer, seems to refer to my Mac Pro, so I can't ping to my home's router.

Feb 13, 2014 2:55 PM in response to Anic264b

I did first set [the Shared] Ethernet 2 to DHCP, following your suggestion, but it assigned the 169 range of IP address;

Perfect. That address is never seen from anywhere, and it SHOULD be an automatically-assigned un-routable 169.254.xxx.yyy address.



then I configured it as “DHCP with a manual address” (remember, I translate to English) and put 192.168.100.1 as the IP adress

The port that you can see and configure must be left alone.


The Software Router created inside your Mac will create its own Router Address, not immediately visible in System Preferences. Its Address can be changed if absolutely necessary, but only in the bowels of unix-land.


Then, I chose to set 192.168.2.28 as Ethernet 2's IP (trying to put it in the same subnet as Ethernet 1).

The shared port that you can see and configure must be left alone.


Since you create a Saftware Router when you share the port, it will not be on the same subnet. The Software Router will forward your packets.

If you want it on the same subnet anytway, expand the subnet mask on the Linux machine.


.

Feb 13, 2014 3:10 PM in response to Grant Bennet-Alder

Grant Bennet-Alder wrote:

Perfect. That address is never seen from anywhere, and it SHOULD be an automatically-assigned un-routable 169.254.xxx.yyy address.

When you say it should, you mean it's just a debug step, correct? You said like I learnt years ago: a 169.254 address is useless. But since we're speaking Apple's own methods, I'm not sure of anything. Do you think I should keep the 169.254 address and left like this?

The port that you can see and configure must be left alone.


The shared port that you can see and configure must be left alone.

Hmm… I can configure all of them. You're referring to Ethernet 2, I presume?

Since you create a Saftware Router when you share the port, it will not be on the same subnet. The Software Router will forward your packets.

If you want it on the same subnet anytway, expand the subnet mask on the Linux machine.

Ok, I'm fine to be on a different subnet, if I can connect.

Thanks.

Feb 13, 2014 3:19 PM in response to Anic264b

In the console, I get these entries:

14.02.14 24:14:12bootpd[40826]server name <computer name>
14.02.14 24:14:12bootpd[40826]interface en0: ip 192.168.2.222 mask 255.255.255.0
14.02.14 24:14:12bootpd[40826]interface en1: ip 192.168.2.1 mask 255.255.255.0
14.02.14 24:14:12bootpd[40826]interface en1: ip 169.254.99.127 mask 255.255.0.0
14.02.14 24:14:12bootpd[40826]interface vnic0: ip 10.211.55.2 mask 255.255.255.0
14.02.14 24:14:12bootpd[40826]interface vnic1: ip 10.37.129.2 mask 255.255.255.0
14.02.14 24:14:12bootpd[40826]dhcp: re-reading lease list
14.02.14 24:14:12bootpd[40826]DHCP DISCOVER [en1]: 1,0:1c:42:9a:37:5e <anic3aec>
14.02.14 24:14:12bootpd[40826]OFFER sent <no hostname> 192.168.2.20 pktsize 300
14.02.14 24:14:12bootpd[40826]DHCP REQUEST [en1]: 1,0:1c:42:9a:37:5e <anic3aec>
14.02.14 24:14:12bootpd[40826]ACK sent <no hostname> 192.168.2.20 pktsize 300
14.02.14 24:14:26natd[41990]failed to write packet back (No route to host)
14.02.14 24:14:27natd[41990]failed to write packet back (Host is down)
14.02.14 24:14:28natd[41990]failed to write packet back (Host is down)
14.02.14 24:14:29natd[41990]failed to write packet back (Host is down)

Would it be possible the request goes from the Linux computer to the Mac Pro but not in the reverse sense?

Feb 13, 2014 3:21 PM in response to Anic264b

When you say it should [be an un-routable 169.254.xxx.yyy] you mean it's just a debug step, correct?

No. That is not an intermediate step. That is what shows up and stays there the whole time while you are using it as a Shared Port. Changing it will not make anything work better.


Hidden from view, it creates and uses a different IP address that does not conflict with your Main Router. This hidden Address will be seen as the "Router Address" that your Linux machine will get when the Linux machine is set to "obtain address via DHCP".

Share internet from Ethernet 2 to Ethernet 1

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