Go Back   The macosxhints Forums > OS X Help Requests > Networking



Reply
 
Thread Tools Rate Thread Display Modes
Old 02-07-2007, 06:52 AM   #1
geordie_git
Prospect
 
Join Date: Feb 2007
Posts: 8
Multiple IP Addresses, osx 10.4.8, Mac Book Pro

Hi,

I've recently switched to a Mac from windows. One thing that I can't work out is how to assign multiple IP Addresses to the on board NIC.

I know this can't be done in the gui, therefore, I assume this must be possible at the back end somehow?

Thanks in advance!
Cheers
Graham
geordie_git is offline   Reply With Quote
Old 02-07-2007, 09:02 AM   #2
displaced
Triple-A Player
 
Join Date: Dec 2002
Location: Kent, United Kingdom
Posts: 105
It certainly can be done via the GUI!

I'm reciting this from memory (at work on a PC at the mo!) but it's something like:

- Go to System Preferences > Network.
- Choose 'Show network port configurations' (or something)
- Find the one for built-in Ethernet
- Click 'Duplicate'

You can now configure each instance with different settings, and you're done.
__________________
Regards,

Chris
displaced is offline   Reply With Quote
Old 02-07-2007, 10:02 AM   #3
ElectricSheep
Triple-A Player
 
Join Date: Mar 2006
Posts: 173
If you just need to quickly assign an IP/subnet alias to an interface, you can do it with the ifconfig command in the Terminal.

sudo ifconfig <if> alias 198.0.2.77/24 where <if> is the interface you want to add an address to (en0, en1, etc)

Last edited by ElectricSheep; 02-07-2007 at 05:00 PM.
ElectricSheep is offline   Reply With Quote
Old 02-07-2007, 11:03 AM   #4
geordie_git
Prospect
 
Join Date: Feb 2007
Posts: 8
Thanks!

Hi There,

Thanks for the tips, I never knew that you could create duplicates!

A windows switcher handbook would be very handy!!

Cheers

Graham
geordie_git is offline   Reply With Quote
Old 02-07-2007, 12:02 PM   #5
geordie_git
Prospect
 
Join Date: Feb 2007
Posts: 8
Does not work...

Hi,

I've added a number of IP Address via the gui, but it does not seem to work. I can't ping any of the new IP Addresses from the network utility. I've rebooted the Mac, but no change.

I've changed the order of the configurations as well, so they are in order.

Am I missing something else?

Cheers

Graham
geordie_git is offline   Reply With Quote
Old 02-07-2007, 12:04 PM   #6
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Are you trying to assign them so they are simultaneously available?
Or are you attempting to have multiple static IPs that you can switch between?
yellow is offline   Reply With Quote
Old 02-07-2007, 12:11 PM   #7
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
I asked a rather similar question but have not yet received a response. Whether you situation is similar to mine, I don't know. I have multiple IPs assigned to a network card and they ARE visible on the other side of my router, but I can only ping the first IP internally. I'm still trying to figure out why. Yellow: At least in my case, I want the simultaneously available. And the ARE...but not inside my building. I'm perplexed.

Joe VanZandt
JDV is offline   Reply With Quote
Old 02-07-2007, 12:19 PM   #8
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Hmmm.. I've never encountered multiple IPs assigned to a single NIC all appearing simultaneously.

If you don't mind me asking.. what's the point of that?
yellow is offline   Reply With Quote
Old 02-07-2007, 12:25 PM   #9
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
I want my website to be on a different IP from other functions on the server. Believe me, this actually works from the outside. I'm still puzzling out why it doesn't work internally.

Joe VanZandt
JDV is offline   Reply With Quote
Old 02-07-2007, 12:46 PM   #10
ElectricSheep
Triple-A Player
 
Join Date: Mar 2006
Posts: 173
The ability to have multiple IP addresses on the same physical interface is very useful if one wants to have multiple services running in jailed environments on the same physical machine. Each jailed environment can have its own IP address given to it. From the outside and from the standpoint of the service, it looks like a completely different host.

Last edited by ElectricSheep; 02-07-2007 at 12:49 PM.
ElectricSheep is offline   Reply With Quote
Old 02-07-2007, 01:27 PM   #11
geordie_git
Prospect
 
Join Date: Feb 2007
Posts: 8
Multiple IP Addresses

The reason is to have access to multiple subnets, that are physically on the same network, but are in different IP Address subnets. It's a development environment. The IP Subnets are not physically separated.

This enables me to have several development environments working on the same network switch, but I need to be able to access them from the one network connection.

Therefore I need to be able to assign different IP Addresses to the one NIC, but for all of them to be usable at the same time.

I get around this problem at the moment, by using XP in Parallels, which works fine. However, as I can use the Remote Desktop Connector on the Mac, the only reason to fire up XP is to remote control the servers. If I can get multiple IP Addresses to work on the Mac, I won't need to start XP.

Makes me life easier (a bit!) if I can get this one sorted.

Cheers

Graham
geordie_git is offline   Reply With Quote
Old 02-07-2007, 05:01 PM   #12
ElectricSheep
Triple-A Player
 
Join Date: Mar 2006
Posts: 173
Try adding the addresses from the command line.

I've done it here with both wireless and wired interfaces, and they work just fine (ARP entries are correct on another machine on my LAN)

It sounds like an environment that might benefit from a VLAN implementation, but you'd need a managed switch infrastructure.

Last edited by ElectricSheep; 02-07-2007 at 05:07 PM.
ElectricSheep is offline   Reply With Quote
Old 02-07-2007, 05:53 PM   #13
cwtnospam
League Commissioner
 
Join Date: Jan 2005
Posts: 8,475
I saw this thread, and out of curiosity, I duplicated my "Built-in Ethernet" port in Network Port Configurations, and then edited the copy. I changed the ip address to configure manually and set a local address, subnet mask, and provided the router info. I'm apple to ping that address, as well as the DHCP provided address, both from my Dual G5, and from my wife's iMac. The only thing I don't know is, how would I specify which network port to use for a given application?
cwtnospam is offline   Reply With Quote
Old 02-07-2007, 09:49 PM   #14
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
Quote:
I'm apple to ping that address,

That's got to be a variant on the Freudian slip, I think.

I assure you, it works perfectly well in my setup when the machine is either on the same subnet OR is external to our router. My problem is that our INTERNAL network (10.0.0.x) machines can't see it, even though they can see the initial address and all other machines on our external network and the whole rest of the internet. That's what has me bedeviled. I can't see why they can't see it!

Joe VanZandt
JDV is offline   Reply With Quote
Old 02-07-2007, 09:59 PM   #15
cwtnospam
League Commissioner
 
Join Date: Jan 2005
Posts: 8,475
Quote:
Originally Posted by JDV
My problem is that our INTERNAL network (10.0.0.x) machines can't see it,

I'm thinking your problem is with the internal router, but I don't know how I'd fix it, other than restart the router.

My question is, how do you assign, for example, a web server to one ip address, and an ftp server to another? Or do they each answer to whomever calls, and leave that up to DNS entries?
cwtnospam is offline   Reply With Quote
Old 02-07-2007, 10:11 PM   #16
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
Well, you just set the webserver up to be on the address you assign it (and list in the DNS servers) and it listens on port 80 on that address. Our FTP server is on a different IP on the same machine. They behave like two different network cards. Of course, this doesn't have heavy traffic or that might be a problem, but more moderate loads, the hardware has no problems.

I'm also thinking it must be router related, but haven't figured out exactly how yet. I'm open to good ideas!

Joe VanZandt
JDV is offline   Reply With Quote
Old 02-07-2007, 10:14 PM   #17
cwtnospam
League Commissioner
 
Join Date: Jan 2005
Posts: 8,475
Quote:
Originally Posted by JDV
Well, you just set the webserver up to be on the address you assign it (and list in the DNS servers) and it listens on port 80 on that address.

I knew it was a bad example when I posted it! What I'm really asking is how do I browse from one address in Safari and from the other in Camino?
cwtnospam is offline   Reply With Quote
Old 02-07-2007, 10:29 PM   #18
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
As I am doing this on a server, that particular question has never occurred to me. If I think of a good answer, I'll post it.

Joe VanZandt
JDV is offline   Reply With Quote
Old 02-07-2007, 11:55 PM   #19
ElectricSheep
Triple-A Player
 
Join Date: Mar 2006
Posts: 173
Sounds like it could be a routing issue. What kind of router are you employing, and how is it configured?
ElectricSheep is offline   Reply With Quote
Old 02-08-2007, 04:14 AM   #20
geordie_git
Prospect
 
Join Date: Feb 2007
Posts: 8
Got it sorted....!

Hi,

Well, instead of using duplicate, I used 'new' instead and that seems to work fine!

I don't know why the duplicate would not play ball.

Thanks for your help.

Cheers

Graham

geordie_git is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.