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 08-05-2015, 02:23 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
Can I remove the iptables rules libvirt creates?


I plan to use libvirt for virtual machines, however I will not be using the virbr0 interface but my own br0 that is bridged with eth0. Should I leave these in here or can I remove them? I feel they are interfering with something. The default iptables rules that libvirt created are these

Code:
*nat
:PREROUTING ACCEPT [106:6522]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.122.0/24 -d 224.0.0.0/24 -j RETURN
-A POSTROUTING -s 192.168.122.0/24 -d 255.255.255.255/32 -j RETURN
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE -$
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE -$
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
# Completed on Wed Aug  5 13:42:08 2015
# Generated by iptables-save v1.4.20 on Wed Aug  5 13:42:08 2015
*mangle
:PREROUTING ACCEPT [671:55154]
:INPUT ACCEPT [669:54896]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [532:65124]
:POSTROUTING ACCEPT [532:65124]
-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
COMMIT
I know how to get rid of the rules with the -A (I just replace it with -D) but I do not know how to get rid of the rules that start with * or :

I also know how to disable the libvirt network via here http://docs.openstack.org/networking...c_libvirt.html
 
Old 08-06-2015, 02:41 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Lookiong at what you posted this is from a file, most likely itpables file. To remove the lines you don't want will depend on a few things. First is your firewall setup to save on exit? Looking at what you posted above it is. You have 2 options.

1. Stop iptables and then edit the file and remove what you don't want but ONLY the ones starting with -A.
2. Use the cli command to remove what you don't want (this method does not stop your firewall).

To use the cli to remove the lines you don't want simply copy the line you want to remove and replace the -A with iptbales -D

Do not remove any other lines!! You will break your firewall.
 
  


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
How can I tell if these iptables rules already exist? iptables -P INPUT ACCEPT iptabl abefroman Linux - Security 1 10-21-2013 03:00 PM
[SOLVED] during system startup, iptables rules not loaded from /etc/sysconfig/iptables danyim Linux - Security 3 04-13-2013 02:09 AM
Problem with libvirt and iptables on a CentOS 6 KVM physical host philx66 Linux - Virtualization and Cloud 1 10-03-2012 05:18 AM
Restore iptables Rules that have been saved with iptables-save tiuz Linux - Security 4 08-14-2010 05:50 PM
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM

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

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