LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2013, 03:30 PM   #1
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Rep: Reputation: 0
Diffrent subnet on server ?


Hello
Well today i had a hard time getting some of the base concept
The case is on one of our servers which host openvz vms i asked datacenter to give us extra ip
the ip they gave us was on diffrent subnet and had diffrent gateway than the main server ip address
I set the ip on the vm and it worked but yet i have some hard time figure out how it actually works

how can an ip address with different gateway and subnet works on a server which its main ip address and gateway is diffrent ?


was not the extra ip supposed to be in same network and have the same gateway as main ip address ?

Also how does linux handle diffrent gateway for extra virtual interfaces ? there is actually one pyhsical network card which can be assgined one gateway as far as i know how adding extra ips to the box is handled ?
though in our case the extra ip is added to openvz vps which makes it harder for me to understand what really happens

Thank you

Last edited by dime111; 01-24-2013 at 03:36 PM.
 
Old 01-24-2013, 07:16 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
You can have any number of logical IP networks share the same physical (layer 2) network. It's not exactly common practice, but there's nothing intrinsically wrong with it either.

Gateways are handled per host. In your case, you have an OpenVZ host in a different subnet from that of the main physical server. That's not fundamentally different from having the two in the same subnet: In both cases, both hosts need an IP address and a gateway. They are, after all, two completely separate systems with separate network configurations. The virtual NIC on the OpenVZ host just happens to be using the NIC of the physical host to send and receive data.

The only somewhat unusual aspect of this setup is that you have two subnets sharing the same layer 2 link.
 
1 members found this post helpful.
Old 01-25-2013, 05:17 AM   #3
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Thank you Ser
But something still bugging me
lets go one step further
Possibly the server is connected to a switch along with some other servers that are connected to the switch
And eventually this switch is connected to one of the datacenter routers
as far as i know about networking this should be normall setup

But here my problem Each port of router can have one subnet assigned to it and this port of router will have one ip address which will be used as gateway for all machine behind this router right ?
ALso by the means the routers work router advertise the network it has via (eigrp,ospf,etc)so it can actually advertise one network for each of its connected port
So how this router can route two diffrent subnet at the same time from a single port (the port that our switch is connected )
If it helps our datacenter is hetzner and they use juniper tech instead of cisco
 
Old 01-25-2013, 06:59 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by dime111 View Post
But here my problem Each port of router can have one subnet assigned to it and this port of router will have one ip address which will be used as gateway for all machine behind this router right ?
No, it is possible to assign several IP addresses to a router interface, which is probably what the hosting company has done here.

A router may act as a gateway for several different networks, and in this case, at least two of those networks share the same Ethernet link.
 
1 members found this post helpful.
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VLAN with 2 Router and 2 Subnet - Is device in different subnet works? velusawme Linux - Networking 2 07-23-2011 10:16 AM
Would like to forward requests received on Server in one subnet to server on another scheidel21 Linux - Networking 3 08-16-2009 09:20 AM
2 Subnet 1 httpd server and 2 dns server how to config? ramnit Linux - Networking 1 06-14-2009 11:33 PM
How do i migrate SAMBA server to diffrent server. Koushik Biswas Linux - Server 1 11-13-2008 08:51 AM
How to assign diffrent ip/hostnames to diffrent services koppaspider Linux - General 1 02-10-2006 09:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration