LinuxQuestions.org
Review your favorite Linux distribution.
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 04-16-2012, 11:44 AM   #1
zefir_psv
LQ Newbie
 
Registered: Apr 2012
Distribution: Debian Squeeze x64, Fedora 16 x64
Posts: 4

Rep: Reputation: Disabled
Question KVM bridge and iptables


I have a server running debian connected to LAN using eth0 port. On the same system I also have two virtual machines running on KVM. These two virtual machines use bridge networking with eth0. Now if under debian I filter out/drop certain packets via iptables those packets will be dropped for debian only, or debian and both kvm's?

Question is, because I have ssh on debian, and www + mail on KVM, and would like to block certain IPs. I am wondering if it's enough to use iptables, or I have to use different "ban" facilities on different OSes in order to "ban" somebody from all services.

Thanks
 
Old 04-17-2012, 03:34 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
iptables on the host will is *able* to affect all traffic going through that box, including all the VM's. If you just make your rules more specific, e.g. include the destination IP / interface of the SSH requests, rather than just port 22, then it's fairly trivial to block traffic to certain machines, including the underlying kvm host itself.
 
1 members found this post helpful.
Old 04-17-2012, 06:51 AM   #3
zefir_psv
LQ Newbie
 
Registered: Apr 2012
Distribution: Debian Squeeze x64, Fedora 16 x64
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you very much! So assuming that on host I have opened port 22 (SSH), and on guest 80 (WWW), if I issue something like this (where x.x.x.x is "bad" pedrson's IP):

Code:
iptables -A INPUT -s x.x.x.x -j DROP
then machine/net from IP x.x.x.x will not be able to use BOTH, SSH and WWW. Is that correct?
 
Old 04-17-2012, 06:54 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
how iptables is configured affects a lot about how this hangs together. With a bridge interface, you'd be using the FORWARD chain to filter traffic to the guests, and INPUT / OUTPUT for the host. But RHEL and similar systems tend to redirect them all to a dedicated chain, so it depends oh the layout methodology really.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] KVM - Bridge, guest works until I start my iptables greenpoise Linux - Virtualization and Cloud 3 01-27-2014 08:50 AM
debian kvm - how to bridge? raindog308 Linux - Virtualization and Cloud 3 11-14-2011 11:07 AM
iptables rate limiting for bridged connection (kvm created bridge) tkmsr Linux - Networking 1 10-28-2010 07:50 AM
[SOLVED] Using KVM public bridge manually sfxpt Linux - Virtualization and Cloud 21 08-18-2010 09:31 AM
Kvm using wireless bridge, how michaelux Linux - Virtualization and Cloud 1 06-07-2010 08:48 AM

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

All times are GMT -5. The time now is 05:54 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