Created
May 14, 2012 18:40
-
-
Save ngsw/2695581 to your computer and use it in GitHub Desktop.
KVM_Setup_Bridge_br0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh | |
| # :Scientific Linux 6 - KVM - インストール : Server World http://www.server-world.info/query?os=Scientific_Linux_6&p=kvm&f=1 | |
| cp -a /etc/sysconfig/network-scripts/ifcfg-{eth0,br0} | |
| echo 'DEVICE=eth0' > /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| grep HWADDR /etc/sysconfig/network-scripts/ifcfg-br0 >> /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 <<'KVMeth0' | |
| ONBOOT=yes | |
| TYPE=Ethernet | |
| BRIDGE=br0 | |
| KVMeth0 | |
| cp -a /etc/sysconfig/network-scripts/ifcfg-br0 /tmp/br0.org | |
| cat > /etc/sysconfig/network-scripts/ifcfg-br0 <<'KVMbr0' | |
| DEVICE=br0 | |
| BOOTPROTO=static | |
| IPV6INIT=no | |
| IPV6_AUTOCONF=yes | |
| NM_CONTROLLED=no | |
| ONBOOT=yes | |
| TYPE=Bridge | |
| DEFROUTE=yes | |
| IPV4_FAILURE_FATAL=yes | |
| KVMbr0 | |
| for i in BROADCAST DNS1 GATEWAY IPADDR NETMASK | |
| do | |
| grep ${i} /tmp/br0.org >> /etc/sysconfig/network-scripts/ifcfg-br0 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment