Jump to content

How to split a virtual & host network

Hello,

 

I am wondering if anyone can help me out with situation that i am having, if there is someone around here that can help me setup my pc & Virtual Box software.

 

What im trying to do is simply this, my motherboard has 2 network cards built in, so i thought to myself instead of leaving one of my network cards just sit there and do nothing, i thought why not use the spare network plug do some work.

 

So my idea is to have my pc which is the host use my "Killer Ethernet Adapter" whilst allowing my virtualbox use the "Intel Ethernet Adapter".

I think i have it setup properly but there isnt anyway i can say for sure that its operating how i would like, so ill list the things that i have done so you can better understand and answer me properly! :)

 

I have changed the settings to my VirtualBox Software to only use my Intel Adapter by, 

 

14y0h1t.jpg

 

So now im guessing that my virtual machine will only be using my INTEL NETWORK ADAPTER, yeah?

I ran a test by disabling the adapter from the host and i couldnt get the internet to work inside the virtual machine, when i enabled it again, i got internet. So this tells me that its actually using the right network adapter, which is what i want it to do.

 

This is whats baffling me...

I had my other network adapter disabled the "Killer Adapter" and could bring up FaceBook and YouTube, but no other website, just came up with a dead page. When i enabled the "Killer Adapter" i could view and surf the web as normal.

But how can i know for sure that my pc which is the host is actually using the Killer Adapter and not the Intel one?

 

Is there any way possible or a setting somewhere to ONLY enable my pc, the HOST to only use nothing but the Killer Adapter?

If so, how would i check it?

 

Cheers,

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Combat_Killer said:

Is there any way possible or a setting somewhere to ONLY enable my pc, the HOST to only use nothing but the Killer Adapter?

If so, how would i check it?

You can change the ipv4 and ipv6 settings of the network card to not assign a ip to those ports.

 

11 minutes ago, Combat_Killer said:

So now im guessing that my virtual machine will only be using my INTEL NETWORK ADAPTER, yeah?

I ran a test by disabling the adapter from the host and i couldnt get the internet to work inside the virtual machine, when i enabled it again, i got internet. So this tells me that its actually using the right network adapter, which is what i want it to do.

You can also look at your switches network panel to see what ports have traffic going through them.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Part of the problem you're going to have with this experiment here is that both of these NICs are on the same network/subnet and share the same Default Gateway so there isn't much to prevent the HOST from using either NIC to go to/from the Internet unless you configured some sort of rule to prevent it.

 

Otherwise telling the VM to use your 2nd NIC should enforce the rule that the VM will only use said NIC since from the VM's perspective it is the only interface that exists. The same cannot be said for the HOST.

53 minutes ago, Combat_Killer said:

This is whats baffling me...

I had my other network adapter disabled the "Killer Adapter" and could bring up FaceBook and YouTube, but no other website, just came up with a dead page. When i enabled the "Killer Adapter" i could view and surf the web as normal.

But how can i know for sure that my pc which is the host is actually using the Killer Adapter and not the Intel one?

 

It's possible these pages were cached by your web browser and that you weren't actually online. A more effective test would be a CMD ping like:

ping 1.1.1.1
or
ping 8.8.8.8
or
ping 1.0.0.1
or
ping 8.8.4.4

If these came back then your HOST was using the opposing NIC. If not then those two web pages were probably just locally cached.

 

Something else that needs to be considered is that your PC, the local host when you want to connect to the Internet is going to check each NIC for a possible Default Gateway. If it see's one NIC is disabled it will check another and send your requests that way if it has an active Default Gateway or even under some circumstances the GOLR, or just send a broadcast out all interfaces and hope for the best. Of course this is dependent on any rules/firewall settings/ACLs you have configured to allow or deny the host applications access over that interface.

 

I can see why you'd want to have that extra port do some work but unless you're experiencing connectivity problems due to rouge broadcasts or other excessive network traffic or a network misconfiguration there isn't really a reason for your specific application here to want to isolate the host traffic from the VM traffic unless you have reason to want to network packet-sniff specifically that VM's traffic from outside the VM. At the end of the day both go to the same switch/router on the same network, to the same Default Gateway. If your host happens to want to use both NICs I say let it. It adds redundancy if that matters to you.

 

Something you can tinker with that may or may not help if you really want some possible solution is you can try adjusting the interfaces metric. A NIC's metric is effectively a manual way of telling the computer that a given NIC is faster than another. This will not tell the host to permanently use a particular NIC but prefer it over another unless the "faster" NIC goes offline. Adjusting the metric will not impact the performance of the host or VM. A lower metric value will tell the host that the interface is faster. CISCO uses the term "cost" on their routers as in the lower the "cost" the faster the NIC. Same principal.

Link to comment
Share on other sites

Link to post
Share on other sites

@Electronics Wizardy

@Windows7ge

 

Cheers guys!

 

I didnt think of that pinging through CMD, but as far as going through the same switch, i could bust out a switch that i have laying around and create a different network config.

 

But as far as the project goes, well the reason why im doing it, is more so for curiosity more or less, you know that IT Tech bug, just thinking if it could be done how would you. Cause at the end of the day im still using the PC resources in order to power the virtual machines, as im aware of that.

 

My biggest problem that i truely have is my modem/router as it came from my ISP and its very limited on what i can do with it, if i had the $$$ i would go and buy my own personal one. The one i have now i cant change DNS settings, cant even boot/disconnect 1 device from it, this shows how limited it is and i hate being tied down with budgetized crap!

 

But thanks again for both of you guys help ;)?

 

Cheers,

 

PS. If i can get it to work ill update this post, just incase someone else might come along in the future and wants to attempt the same thing :)?

 

Link to comment
Share on other sites

Link to post
Share on other sites

39 minutes ago, Combat_Killer said:

I didnt think of that pinging through CMD, but as far as going through the same switch, i could bust out a switch that i have laying around and create a different network config.

That would not be necessary. If you have a dedicated switch you could run two networks off of it. Most if not all basic consumer switches operate on Layer 2 of the OSI model. This means traffic is forwarded based on MAC not IP (Layer 3). This would allow you to run multiple networks on a single switch. If you do try though be wary that running multiple DHCP servers on the same switch will give you a bad time. That is unless you have a managed switch that allows the configuration of VLANs. You can still use multiple routers on a single unmanaged switch but to work around that issue you'd need to disable DHCP and assign Static IP addresses.

 

47 minutes ago, Combat_Killer said:

My biggest problem that i truely have is my modem/router as it came from my ISP and its very limited on what i can do with it, if i had the $$$ i would go and buy my own personal one.

Their are free Linux distributions (like pfSense) that function as routers. These can be installed on any PC hardware and don't require anything particularly powerful. An old dual core with a couple gig's of RAM would more than suffice. From there you'd just have to pray that the ISP modem/router allows you to set it to Bridged Mode. Then you'd have an OP router with 100% control of everything.

 

52 minutes ago, Combat_Killer said:

The one i have now i cant change DNS settings

You can set DNS on a system by system basis manually if you want. Manually assigning DNS on a computer will bypass your ISP DNS. Tedious yes but it's a work around.

Link to comment
Share on other sites

Link to post
Share on other sites

@Windows7ge

 

Yeah unfortunately with my modem the only thing i can really do is look at things and hit the reset button to reboot the modem and thats virtually it.

 

About Linux i was actually considering of putting together a linux based OS on a little PC that i have laying around just so i can dibble and dabble with it, i played around with ubuntu like 10-15yrs ago and thats about it, never really gotten back into linux.

But i am seriously now contemplating on getting off my lazy ass and learn linux, as linux has come a far way from what i can tell, dont get me wrong tho i like windows, but i feel like companies like microsoft and apple are so consumed by the $$$ in the market that they are now to the point where they are just bullies now.

 

I have book myself in school to do the 4 or 5 yr cisco course, i used to install servers and local machines for small businesses, but due to my health condition i had to shut up shop. But i do miss the work tho, lol just thinking how geekish that sounds.

 

So im kind of thinking of doing a server setup at home, but instead of running microsoft software ill run a nas with linux. At least this way i can keep myself on top of things like server side tech, which i really do love and miss. 

 

Which was half of the reason why i was tempting this little project of splitting the nic's, cause i was going to run linux through virtual box just to learn and get the gist of it. So i was going to run virtual box with linus OS and use my PC as like a local machine on the server, that way i could learn things with out having have to run between PC to PC.

But i think the best way to go is just pull out this shitty old PC that i got put linux on it and do things that way as trying to run it from one PC would just be making it harder for me to diagnose if something were to go wrong.

 

As far as changing DNS on local machine, yeah im doing that right now, as my ISP has blocked certain websites that i can not access, unless i change the DNS settings on the local machines. Thats another thing that really shits me with this shitty ISP modem, i can not create static IP and address to machines on the network, etc... I prefer to do things old school and do things manually cause i dont really like this automated stuff, cause when things go wrong its very hard to diagnose them.

 

When you ask to get something fixed now in Windows 10 it doesnt tell you anything, whereas 2000NT and WinXP at least showed you what it was looking at and diagnosing and when you saw the system hang on that particular area you knew, ok i think thats where the problem is... Now windows 10 just says TROUBLESHOOTING and when its finished it just says cant fix, contact blah blah to take a look.

 

Which is why im thinking of switching to linux, my problem is i gotta get off my ass and learn it, lol.

Got on any suggestions on linux OS, for server side OS and local mach based OS?

 

Cheers,

Link to comment
Share on other sites

Link to post
Share on other sites

Within that many years Linux has come a long way. Linux as a whole has become much more user friendly including very colorful and intuitive GUI's & WebUIs. With this though it is still very CLI incorporated. Many of the most helpful and time efficient tools are CLI via the Terminal so getting the most out of Linux really has you using both.

 

All the distros I've been playing with are based on Debian but there also Arch Linux, BSD...that's all I have off the top of my head but trust me the list goes on.

 

For Desktop distros based on Debain you can checkout Ubuntu, Mint, Kubuntu, Lubuntu, SparkyLinux

For File Server distros you can checkout FreeNAS (based on FreeBSD uses ZFS), Ubuntu Server  (Debian), CentOS (based on RHEL), Rockstor (uses BTRFS)

 

If you want to explore making virtual machines you can checkout PROXMOX (Debian)

 

Then as I mentioned if you want to explore distros designed for network appliances you can check out pfSense which is for routers but you can also check out VyOS which can be used as a router but also a fully managed network switch.

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, Windows7ge said:

Within that many years Linux has come a long way. Linux as a whole has become much more user friendly including very colorful and intuitive GUI's & WebUIs. With this though it is still very CLI incorporated. Many of the most helpful and time efficient tools are CLI via the Terminal so getting the most out of Linux really has you using both.

 

All the distros I've been playing with are based on Debian but there also Arch Linux, BSD...that's all I have off the top of my head but trust me the list goes on.

 

For Desktop distros based on Debain you can checkout Ubuntu, Mint, Kubuntu, Lubuntu, SparkyLinux

For File Server distros you can checkout FreeNAS (based on FreeBSD uses ZFS), Ubuntu Server  (Debian), CentOS (based on RHEL), Rockstor (uses BTRFS)

 

If you want to explore making virtual machines you can checkout PROXMOX (Debian)

 

Then as I mentioned if you want to explore distros designed for network appliances you can check out pfSense which is for routers but you can also check out VyOS which can be used as a router but also a fully managed network switch.

Geez thanks for the info, thanks for giving a head start!

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Combat_Killer said:

Geez thanks for the info, thanks for giving a head start!

I should also mention that's just the tip of the iceberg there's also distros like Pop, Arch, & Manjaro (all desktop), for servers there's also Redhat Linux & UnRAID but those two cost money.

 

Linux as a whole has gained an enormous following and many people have backed the further development of many many different forks of the kernel with different GUIs, features, & functions.

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/2/2019 at 10:56 PM, Windows7ge said:

I should also mention that's just the tip of the iceberg there's also distros like Pop, Arch, & Manjaro (all desktop), for servers there's also Redhat Linux & UnRAID but those two cost money.

 

Linux as a whole has gained an enormous following and many people have backed the further development of many many different forks of the kernel with different GUIs, features, & functions.

Yeah cool,

 

It wasnt around til 2005'ish give or take a year or 2 was when my friend and I started dabbing into Linux, we first started off with Ubuntu, then a little of mint & manjaro.

As those names sound familiar to me, and i think Citrix too, but i could be wrong.

 

The reason why we stopped was because we were running into barriers, and my friend and i werent developers or coders, as we were learning, but only if we had someone that was knowledgable enough to teach and show us, perhaps we could of learnt it.

But at that time there wasnt any REAL info, and trying to get software and hardware to work was a nightmare for us...

For example. we were trying to get our optical drive to work, and after around a week or so we still couldnt get it to work, i just remember reading one guide after another, trying all the different methods etc... And still nothing.

 

We knew back then my friend and i that Linux would take off and be awesome if someone would just make a linux OS like Ubuntu to be similar like windows it would take off, we were wanting to do that ourselves, but because my friend and i were very limited in what we can do. Meaning it was one thing reading and understanding code, but starting from scratch like creating code, thats another thing!

 

But this course i have booked myself in, the teachers have told me that i would be dealing with Linux base software, so i was very curious on how far Linux had come wince last time my friend and i played with it.

Before you say Linux and no one would ever know what your talking about, now i have started seeing website support for Linux, like gaming platforms, steam, nvidia etc...

 

Going from trying to install everything manually for every single thing compared to seeing how companies have linux support on their websites, it might not ba as daunting now as it was last time. Plus also things have changed too hardware wise, like optical drives, who has optical drives now??? i mean i have a Blu-Ray player, slash DVD burner and i havent used for that long that when i put a disc in it the other day the thing was loud as fuck and grinding it ass off, lol!!!

I have had my optical drive in my PC now for roughly 6yrs, give or take a few yrs, and i only ever used the thing a couple of times just to install my Win7 OS, and ripped a few movies from DVD to hard drive.

So going from my friend and i spending weeks trying to install an optical driver for linux, to not even needing an optical drive, boy things have come a long way, i just watch a Linus vid the other day where now you boot off Linux on a thumb drive, A BLOODY FUCKING THUMB DRIVE !!! Without even touching the main OS, i was in total shock, let me tell ya.

This was unheard of back in the day.
 

But anyhow, you have given me a great start and after watchin that linus vid, i had downloaded PoP-OS, it was going to load it onto my virtual machine to have a look around, but im thinking perhaps ubuntu is the way to go to be perfectly honest, as it looks like a more industry standard, but i know more once i start my ccna course to see how and where linux is used.

 

Cheers,

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, Combat_Killer said:

i know more once i start my ccna course to see how and where linux is used.

If your CCNA classes teach the same things I learned in mine they won't teach you much of anything about Linux. The class quite tightly wraps around how to configure CISCO's proprietary equipment and how to have it interact with other network/internet devices. Along with teaching you all the network protocols. Doesn't cover much if anything Linux outside of if the equipment OS is based off it.

Link to comment
Share on other sites

Link to post
Share on other sites

Just to reaffirm what was said - set the IP of your intel card on your host's NIC settings to a subnet not being used on your network. Say if your home network uses 192.168.1.0/24 then set the intel NIC to 10.0.0.1/24 with no gateway. Normally you do not want 2 NICs on the same subnet unless they are Teamed / LACP-LAGG / bonded in some way.

 

This won't impact the VMs ability to bridge to the interface and still pull a 192.168.1.0/24 IP.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×