Jump to content
Boone

Setting Multi Static IP addresses

Recommended Posts

Hello I am needing help setting multi static ip address. The the thing is I know how to add them with ifconfig eth0:0 192.168.1.2 and Assign second IP: ifconfig eth0:1 192.168.1.3 and so on you know the drill. I know I have typed local ip addresses for a example but I am talking about real IP addresses. Well ok this is my issue I have more ip address from my ISP but they are from a different block of ips and they have a different gateway, broadcast,netmask and so on. I just was wondering if I still can keep them on the same nic card as the other block of ips ? I am pretty new to this side of linux. Please help me and give me some feed back.

Share this post


Link to post
Share on other sites

Yep, what I think you should be doing though is creating VLAN's:

 

http://www.linuxsolutions.org/index.php?op...8&Itemid=26

 

here is howto I wrote on how to make them. This means that whilst you add the IP's to the card, the VLAN side of things keeps the networks separate. Then, if there are any other machines that need to see that particular IP, they also have to be in the specific VLAN so that it can communicate.

 

For example, I could have:

 

VLAN 10 = 192.168.1.0

VLAN 20 = 10.1.1.0

 

these are the two networks. So, if there were two machines:

 

10.1.1.1

10.1.1.2

 

then they'd both have to have VLAN 20 configured to communicate with that particular VLAN. The same for VLAN 10. However, VLAN 20 cannot see machines in VLAN 20. This is normal, but you can use routing between the two VLAN's if you need that type of connectivity.

Share this post


Link to post
Share on other sites

This seems like quite a task but then again I am pretty new to this side of things like I said. I allso wanted to ask can all this be done remotely or do I need to be in the consle? I was hopeing to add allthese via SSH becasue the system is over 100 miles from me. If you dont mind can you show me some commands to enter for examples to make sure I do it correctly. I really do not want to screw this up and make the server be unreachable if I do it remotely. Thanks for your help

Share this post


Link to post
Share on other sites

The commands are in the link I posted, so you can do it all from this. Providing you don't change the IP address of eth0 itself, you shouldn't have a problem gaining access via SSH. The interface then becomes eth0.xx where xx is the VLAN number, so this is all you should be using to assign the IP address.

 

To be safe, once you've made the VLAN's, try to open another SSH session before you exit the active one to make sure you can still connect. However, before you even do any of this, I suggest you know a bit more about the network setup at the other end otherwise this might not achieve what you want it to do.

Share this post


Link to post
Share on other sites

Yes I did take note to the link but I guess I am really slow or missing something. I still trying to figgure out how change the gateway for the new set ip addresses becasue it is a differnt gateway ip.

Share this post


Link to post
Share on other sites

Each of those particular IP's, should have a subnet mask. Therefore, you'd be setting the gateway for that particular subnet, not a default gateway for all other traffic. To give you specifics, I'll have to make it and then show you here what you need to do exactly. I will have to work with private IP's though, since I won't be able to replicate public IP's as I don't have any to use as examples.

Share this post


Link to post
Share on other sites

ok I have i got 68.XXX.XXX.2 and 68.XXX.XXX.4 and there gateway is 68.XXX.XXX.1 Bcast:68.XX.XXX.127 Mask:255.255.255.128 thats what I have now and my isp is going to give me a set of other ip address but they are in a differnt block and differnt gateway they told me becasue they have none left in the same block. I trying to figure out how to add the ips when they differnt range n whatever. Do you need the ips in the differnt block ? I mean I can get that info for you as well if you need it.

Share this post


Link to post
Share on other sites

I'm pretty sure all of this is possible, but I don't know much about the network setup where this particular machine is. Is it connected to a switch? Can you configure the switch? If so, can you configure VLAN's on it?

 

If not, then I wouldn't use VLAN's. The "ip addr" command will allow you to add IP's to eth0 easily enough. What are you trying to achieve by binding all of these IP's to one machine anyway? The gateway is also an issue I'm wondering about since if it's supposed to be returning out to the internet, I can't see how it will do it. There will always be one default gateway for 0.0.0.0 for one particular gateway IP - and that you won't be able to do for all these subnets. If you want each network to have a default gateway, then it will have to be VLAN's, and if you can't configure the switch or the networks that the server is located - you won't be able to do that either.

Share this post


Link to post
Share on other sites

Well It is connected to my ISP CiSCO ONS system wich they give me no access to change settings to. This is where they have pointed the IP addresses to. I guess my other choice is to use a 2nd nic card with the new block of IP addresses in the server ? I been thinking this is prob. the best way to do things and it should be simple. Thanks so much for your help

Share this post


Link to post
Share on other sites

Even with a second card in the machine, you'll still have the routing problem.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...