{ "created": "2015-12-20T19:56:51Z", "hierarchy": [ { "name": "ROOT", "type": "folder", "uri": "/ROOT" }, { "name": "Bridged Networking on a KVM Hypervisor", "type": "article", "uri": "Bridged_Networking_on_a_KVM_Hypervisor" } ], "html": "\n\n \n \n \n \n \n \n \n \n \n \n \n Bridged Networking on a KVM Hypervisor – Nikhil's Personal Wiki\n \n \n \n \n \n
\n
\n \n
\n
\n \n \n\n

Bridged Networking on a KVM Hypervisor\n \n

\n

We will be adding a bridge vnet0 to interface eth0

\n
[root@otoscope ~]# brctl show  \nbridge name bridge id         STP enabled interfaces  \nvirbr0      8000.000000000000 yes\n

Now add this to /etc/sysconfig/network-scripts/ifcfg-vnet0

\n
DEVICE=vnet0  \nTYPE=Bridge  \nBOOTPROTO=dhcp  \nONBOOT=yes\n

Add BRIDGE=vnet0 to /etc/sysconfig/network-scripts/ifcfg-eth0:

\n
# Intel Corporation 82579LM Gigabit Network Connection  \nDEVICE=eth0  \nBOOTPROTO=dhcp  \nHWADDR=00:25:90:53:A0:43  \nONBOOT=yes  \nBRIDGE=vnet0\n

Restart the network service and add the bridge:

\n
service network restart  \nbrctl addif vnet0 eth0\n

Check:

\n
[root@otoscope ~]# brctl show  \nbridge name bridge id          STP enabled interfaces  \nvirbr0      8000.000000000000  yes     \nvnet0       8000.00259053a043  no           eth0\n

Now add STP with:

\n
brctl stp vnet0 on\n
\n

Firewall Rules

\n

Make sure that you’ve set up the proper forwarding rules with IPTables.
\nDon’t use a general free-for-all like this, though:

\n
iptables -A FORWARD -m state --state NEW -j ACCEPT\n
\n

References

\n\n\n\n
\n \n
\n \n \n \n \n \n\n", "id": "6687431f-0f25-54ce-bacf-4ed9edcae155", "modified": "2023-05-03T20:33:13Z", "revisions": [ { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2023-05-03T20:33:13Z", "id": "13fd9aa2c17070823012a12dd946d050e3ed6bf3", "shortId": "13fd9aa2", "subject": "Initial commit\n", "content": "We will be adding a bridge `vnet0` to interface `eth0`\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id         STP enabled interfaces \nvirbr0      8000.000000000000 yes\n```\n\nNow add this to `/etc/sysconfig/network-scripts/ifcfg-vnet0`\n\n```bash\nDEVICE=vnet0 \nTYPE=Bridge \nBOOTPROTO=dhcp \nONBOOT=yes\n```\n\nAdd `BRIDGE=vnet0` to `/etc/sysconfig/network-scripts/ifcfg-eth0`:\n\n```bash\n# Intel Corporation 82579LM Gigabit Network Connection \nDEVICE=eth0 \nBOOTPROTO=dhcp \nHWADDR=00:25:90:53:A0:43 \nONBOOT=yes \nBRIDGE=vnet0\n```\n\nRestart the network service and add the bridge:\n\n```bash\nservice network restart \nbrctl addif vnet0 eth0\n```\n\nCheck:\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id          STP enabled interfaces \nvirbr0      8000.000000000000  yes    \nvnet0       8000.00259053a043  no           eth0\n```\n\nNow add STP with:\n\n brctl stp vnet0 on\n\nFirewall Rules\n--------------\n\nMake sure that you've set up the proper forwarding rules with IPTables.\nDon't use a general free-for-all like this, though:\n\n iptables -A FORWARD -m state --state NEW -j ACCEPT\n\nReferences\n----------\n\n* [A most **excellent** overview of the `brctl`\n command](http://www.lainoox.com/bridge-brctl-tutorial-linux/).\n* [Here's another](http://www.dd-wrt.com/wiki/index.php/Brctl_command).\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-27T07:27:56Z", "id": "5a5b1a32f41081d062ab86f8869a961bcad79668", "shortId": "5a5b1a32", "subject": "Fix Markdown conversion\n\nSaw half a season of The Office\n", "content": "We will be adding a bridge `vnet0` to interface `eth0`\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id         STP enabled interfaces \nvirbr0      8000.000000000000 yes\n```\n\nNow add this to `/etc/sysconfig/network-scripts/ifcfg-vnet0`\n\n```bash\nDEVICE=vnet0 \nTYPE=Bridge \nBOOTPROTO=dhcp \nONBOOT=yes\n```\n\nAdd `BRIDGE=vnet0` to `/etc/sysconfig/network-scripts/ifcfg-eth0`:\n\n```bash\n# Intel Corporation 82579LM Gigabit Network Connection \nDEVICE=eth0 \nBOOTPROTO=dhcp \nHWADDR=00:25:90:53:A0:43 \nONBOOT=yes \nBRIDGE=vnet0\n```\n\nRestart the network service and add the bridge:\n\n```bash\nservice network restart \nbrctl addif vnet0 eth0\n```\n\nCheck:\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id          STP enabled interfaces \nvirbr0      8000.000000000000  yes    \nvnet0       8000.00259053a043  no           eth0\n```\n\nNow add STP with:\n\n brctl stp vnet0 on\n\nFirewall Rules\n--------------\n\nMake sure that you've set up the proper forwarding rules with IPTables.\nDon't use a general free-for-all like this, though:\n\n iptables -A FORWARD -m state --state NEW -j ACCEPT\n\nReferences\n----------\n\n* [A most **excellent** overview of the `brctl`\n command](http://www.lainoox.com/bridge-brctl-tutorial-linux/).\n* [Here's another](http://www.dd-wrt.com/wiki/index.php/Brctl_command).\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-21T02:30:47Z", "id": "3f2c54b1d767218fcb4855fbac306b015afaf551", "shortId": "3f2c54b1", "subject": "Incremental\n", "content": "We will be adding a bridge `vnet0` to interface `eth0`\n\n` [root@otoscope ~]# brctl show` \n` bridge name bridge id         STP enabled interfaces` \n` virbr0      8000.000000000000 yes`\n\nNow add this to `/etc/sysconfig/network-scripts/ifcfg-vnet0`\n\n` DEVICE=vnet0` \n` TYPE=Bridge` \n` BOOTPROTO=dhcp` \n` ONBOOT=yes`\n\nAdd `BRIDGE=vnet0` to `/etc/sysconfig/network-scripts/ifcfg-eth0`:\n\n` # Intel Corporation 82579LM Gigabit Network Connection` \n` DEVICE=eth0` \n` BOOTPROTO=dhcp` \n` HWADDR=00:25:90:53:A0:43` \n` ONBOOT=yes` \n` BRIDGE=vnet0`\n\nRestart the network service and add the bridge:\n\n` service network restart` \n` brctl addif vnet0 eth0`\n\nCheck:\n\n` [root@otoscope ~]# brctl show` \n` bridge name bridge id          STP enabled interfaces` \n` virbr0      8000.000000000000  yes   ` \n` vnet0       8000.00259053a043  no           eth0`\n\nNow add STP with:\n\n`  brctl stp vnet0 on`\n\nFirewall Rules\n--------------\n\nMake sure that you've set up the proper forwarding rules with IPTables.\nDon't use a general free-for-all like this, though:\n\n` iptables -A FORWARD -m state --state NEW -j ACCEPT`\n\nReferences\n----------\n\n- [A most **excellent** overview of the `brctl`\n command](http://www.lainoox.com/bridge-brctl-tutorial-linux/).\n- [Here's\n another](http://www.dd-wrt.com/wiki/index.php/Brctl_command).\n\n\n\n" }, { "authorEmail": "mail@nikhil.io", "authorName": "Nikhil Anand", "date": "2015-12-20T19:56:51Z", "id": "3db6af94e7f4c031351915cca5b6e4289f0870fc", "shortId": "3db6af94", "subject": "Bridged Networking on a KVM Hypervisor : First Draft", "content": "We will be adding a bridge `vnet0` to interface `eth0`\n\n` [root@otoscope ~]# brctl show` \n` bridge name bridge id         STP enabled interfaces` \n` virbr0      8000.000000000000 yes`\n\nNow add this to `/etc/sysconfig/network-scripts/ifcfg-vnet0`\n\n` DEVICE=vnet0` \n` TYPE=Bridge` \n` BOOTPROTO=dhcp` \n` ONBOOT=yes`\n\nAdd `BRIDGE=vnet0` to `/etc/sysconfig/network-scripts/ifcfg-eth0`:\n\n` # Intel Corporation 82579LM Gigabit Network Connection` \n` DEVICE=eth0` \n` BOOTPROTO=dhcp` \n` HWADDR=00:25:90:53:A0:43` \n` ONBOOT=yes` \n` BRIDGE=vnet0`\n\nRestart the network service and add the bridge:\n\n` service network restart` \n` brctl addif vnet0 eth0`\n\nCheck:\n\n` [root@otoscope ~]# brctl show` \n` bridge name bridge id          STP enabled interfaces` \n` virbr0      8000.000000000000  yes   ` \n` vnet0       8000.00259053a043  no           eth0`\n\nNow add STP with:\n\n`  brctl stp vnet0 on`\n\nFirewall Rules\n--------------\n\nMake sure that you've set up the proper forwarding rules with IPTables.\nDon't use a general free-for-all like this, though:\n\n` iptables -A FORWARD -m state --state NEW -j ACCEPT`\n\nReferences\n----------\n\n- [A most **excellent** overview of the `brctl`\n command](http://www.lainoox.com/bridge-brctl-tutorial-linux/).\n- [Here's\n another](http://www.dd-wrt.com/wiki/index.php/Brctl_command).\n\n[Category:Nikhil's Notes](Category:Nikhil's_Notes \"wikilink\")\n[Category:From a past sysadmin\nlife](Category:From_a_past_sysadmin_life \"wikilink\")\n" } ], "sizeInBytes": 1413, "source": "We will be adding a bridge `vnet0` to interface `eth0`\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id         STP enabled interfaces \nvirbr0      8000.000000000000 yes\n```\n\nNow add this to `/etc/sysconfig/network-scripts/ifcfg-vnet0`\n\n```bash\nDEVICE=vnet0 \nTYPE=Bridge \nBOOTPROTO=dhcp \nONBOOT=yes\n```\n\nAdd `BRIDGE=vnet0` to `/etc/sysconfig/network-scripts/ifcfg-eth0`:\n\n```bash\n# Intel Corporation 82579LM Gigabit Network Connection \nDEVICE=eth0 \nBOOTPROTO=dhcp \nHWADDR=00:25:90:53:A0:43 \nONBOOT=yes \nBRIDGE=vnet0\n```\n\nRestart the network service and add the bridge:\n\n```bash\nservice network restart \nbrctl addif vnet0 eth0\n```\n\nCheck:\n\n```bash\n[root@otoscope ~]# brctl show \nbridge name bridge id          STP enabled interfaces \nvirbr0      8000.000000000000  yes    \nvnet0       8000.00259053a043  no           eth0\n```\n\nNow add STP with:\n\n brctl stp vnet0 on\n\nFirewall Rules\n--------------\n\nMake sure that you've set up the proper forwarding rules with IPTables.\nDon't use a general free-for-all like this, though:\n\n iptables -A FORWARD -m state --state NEW -j ACCEPT\n\nReferences\n----------\n\n* [A most **excellent** overview of the `brctl`\n command](http://www.lainoox.com/bridge-brctl-tutorial-linux/).\n* [Here's another](http://www.dd-wrt.com/wiki/index.php/Brctl_command).\n", "title": "Bridged Networking on a KVM Hypervisor", "untracked": false, "uri": "/Bridged_Networking_on_a_KVM_Hypervisor", "relativePath": "Bridged Networking on a KVM Hypervisor.md" }