Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-24-2013, 05:16 AM
|
#1
|
LQ Newbie
Registered: Aug 2013
Posts: 5
Rep: 
|
two NICs one switch
I'm new to networking, but I want an internal network between two machines that are already on a subnet (with static/public IP's each)
Given both machines have a spare NIC's - can I just hook them upto the same switch and make one machine the gateway? Or is there a simpler way of setting up VLAN's? Any thoughts?
Last edited by pranix; 08-24-2013 at 12:35 PM.
|
|
|
08-24-2013, 12:31 PM
|
#2
|
Member
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891
Rep: 
|
Not sure I follow. You have two hosts with two nics each?
Each host is connected via one nic to a switch?
The switch ports are what, Access (or member) ports in one vlan, call it vlanX?
The hosts both in the same existing subnet and are talking to the outside world via a 3rd host or router acting as a gateway?
You want to connect between the two hosts on a separate subnet? For what purpose?
Assuming the above is correct you have three choices.
1. crossover cable between the two hosts second nic
2. second nics connect to a new switchport each, the new switchports are made access ports of vlanY
3. the existing nics are reconfigured as 802.1q tagged trunks and vlanX and Y are trunked between the two existing nics
We need a clearer description of where you are and where you want to get to to be more specifically helpful :-)
Diagrams are the best if you can run up visio or dia (or indeed kivio)
|
|
|
08-24-2013, 12:43 PM
|
#3
|
LQ Newbie
Registered: Aug 2013
Posts: 5
Original Poster
Rep: 
|
I meant switch not NIC, my bad. (But have edited original post now). Below are answers -
Not sure I follow. You have two hosts with two nics each? - Yes
Each host is connected via one nic to a switch? - Yes
The switch ports are what, Access (or member) ports in one vlan, call it vlanX? - Yes, but not sure of Vlan - but all are on same subnet (physical ethernet ports connecting to switch and onto a core switch within a DC)
The hosts both in the same existing subnet and are talking to the outside world via a 3rd host or router acting as a gateway? - Talking straight to outside world (public DNS set with gateway/router on same subnet, no 3rd host)
You want to connect between the two hosts on a separate subnet? For what purpose? - Not just two hosts, but more, I mentioned to keep it simple. Purpose is to have more virtualbox vm's to be configured over a bridged interface.
I hope it's clearer - but will try and put it onto a visio/dia if necessary.
Thanks again.
|
|
|
08-26-2013, 06:31 PM
|
#4
|
Member
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891
Rep: 
|
OK, so to keep it simple,
assign nic2 to the vm and connect it to the switch.
create a new vlan on the switch, and make the new ports members of that vlan.
Create a new subnet and assign addresses to the VM.s 2nd nic.
At this point your VM's should be able to talk amongst themselves via this new vlan/subnet.
If you want to route traffic via this subnet you will need to get the subnet added to the router/gateway. You will then need need to add a route to the vm's for whichever networks you need to talk to via the routers new subnet address.
I'm assuming the VM's already have a default route via the existing subnet and router. If this is the case DO NOT add another default route to the VM's. I cannot stress this enough, the number of times I have had to fix this are beyond count.....
For each host real or virtual you have ONE default route. Any other routing must be by explicit routing.
|
|
|
08-27-2013, 10:39 AM
|
#5
|
LQ Newbie
Registered: Aug 2013
Posts: 5
Original Poster
Rep: 
|
The servers are connected to a dumb switch, and then onto a core DC switch. I don't have access to the gateway too.
Am wondering to replace the dumb-switch with something where I can create VLAN's on, unless there are other ways to get around.
I did try to create VLAN's on these servers over the existing interface - but that breaks my access over the switch (although it works fine from within) - not sure why though.
|
|
|
08-27-2013, 12:11 PM
|
#6
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,551
|
With networking, KEEP IT SIMPLE
But a new cheap switch and plug them in to that rather than going to the expense of a switch that will support vlan or port segmentation.
|
|
|
08-27-2013, 12:38 PM
|
#7
|
LQ Newbie
Registered: Aug 2013
Posts: 5
Original Poster
Rep: 
|
Yes - I love keeping it simple.
But now that many of my networking assumptions have fallen apart - I want to be sure this one extra switch to connect all 2nd NIC's is going to solve. Also, that any of the servers can be the gateway without any routes set up. Or am I completely mistaken?
|
|
|
08-30-2013, 07:16 PM
|
#8
|
Member
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891
Rep: 
|
You can use a second switch if thats cheaper/easier but all you have done is to create a switched network over which all the servers can talk.
This would be typical for doing things like database replication that avoids using the main network.
But when you say you want any of the servers to act as a gateway? Where to? All of your servers are already connected to the outside world via the gateway on your existing network so they would not need to route via each other.
Look -
Adding a new switch will connect your servers and allow them to talk via the new IP network you assign. To talk to anything else they will go via the existing gateway. If you want to route somewhere that is not available via your current gateway then you need another gateway, weather its a router or a server with forwarding enabled, which needs to be connected physically and logically to your new network.
You need to start drawing pictures. First draw out exactly where you are, then draw out exactly what it is you are trying to achieve, because you seem to keep adding pieces to the puzzle. Get it clear in your head what you are trying to achieve, then it will be easier for us to help you get there :-)
Last edited by baldy3105; 08-30-2013 at 07:20 PM.
|
|
|
All times are GMT -5. The time now is 01:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|