LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-15-2017, 09:56 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Can iptables affect my VMs?


Hello.
I use VirtualBox in my Linux Debian amd64 and use some iptables rules also. My VM networking is set to "NAT" but in VM I can't connect to Tor network? my VM in Windows 7.

Thank you.
 
Old 01-15-2017, 10:19 AM   #2
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Yes
 
Old 01-17-2017, 06:38 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
If Linux is the host, then iptables (or any other such command ...) will necessarily affect all of your VMs.

Why? Because, from the host's point-of-view, the virtual-machine monitor is (so to speak ...) "just another application."

No matter what "the various VMs think they see," the actual physical environment is controlled by the host alone. Every request of any sort that is made by any virtual machine is ultimately translated to a request that is made by the virtual-machine monitor application to the host upon which it runs.

Of course, the virtual machines never directly perceive the host environment. For them, "the magic-trick is never revealed."

Last edited by sundialsvcs; 01-17-2017 at 06:44 PM.
 
Old 01-22-2017, 09:43 AM   #4
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Even my VM network was "NAT" ????
 
Old 01-22-2017, 11:10 AM   #5
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Yes
 
Old 01-24-2017, 08:59 AM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
How about Bridging? Can it affected too?
 
Old 01-24-2017, 10:59 AM   #7
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Yes
 
Old 02-05-2017, 08:59 AM   #8
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Ah, Why? Bridging mean my VM can see NIC directly
 
Old 02-06-2017, 03:11 AM   #9
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by hack3rcon View Post
Bridging mean my VM can see NIC directly
No it does not. Bridging means that the virtual adapter created by the virtualization system to be used inside the VM is bridged with the physical adapter of your choice. It is still under the host OS' control as far as network packets are concerned.
Now, you only asked that "Can iptables affect my VMs", the answer is yes, they can. But if you have no rules that are specific to your VMs network devices they will not be affected.

Actually PCI passthrough does what you said ("see NIC directly"). If you use PCI passthrough (or USB if the NIC is USB), the kernel will actually replace the NIC driver with a "stub" driver that makes possible passing all control to the VM. This way the VM manages the NIC directly with it's native drivers.
Of course this means that the NIC will be withdrawn from the host OS' networking altogether (thus no host iptables can affect it) and probably this is not what you typically want.

Last edited by gradinaruvasile; 02-06-2017 at 03:25 AM.
 
  


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
[Tcptraceroute/Traceroute/Ping] Windows VMs & Linux VMs BiFo Linux - Networking 0 08-24-2010 02:07 PM
LXer: Using Xen With LVM-Based VMs Instead Of Image-Based VMs (Debian Etch) LXer Syndicated Linux News 0 01-14-2009 08:20 PM
iptables rules doesn't seem to affect openntpd reverse Linux - Security 14 11-25-2007 04:33 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
vms geletine Other *NIX 9 12-10-2005 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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

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