Monday, January 18, 2016

Centos 6 bridge network

Directory /etc/sysconfig/network-scripts/

Note:
Instead of turning off NetworkManager , add "NM_CONTROLLED=no " to the ifcfg-* .

Edit or create /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
# change the hardware address to match the hardware address your NIC uses
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no

Edit or create /etc/sysconfig/network-scripts/ifcfg-br0 dhcp:
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no
DELAY=0

Edit or create /etc/sysconfig/network-scripts/ifcfg-br0 static
DEVICE=br0
TYPE=Bridge
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
DELAY=0

# service network restart

Iptables
# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
# service iptables save
# service iptables restart

Edit and append /etc/sysctl.conf:
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

Reload kernel parameter and libvirt service
# sysctl -p /etc/sysctl.conf
# service libvirtd reload

# brctl show

-----------------------------
2 nic bond
-----------------------------
Edit or create /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
# change the hardware address to match the hardware address your NIC uses
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no
USERCTL=no
SLAVE=yes
MASTER=bond0

Edit or create /etc/sysconfig/network-scripts/ifcfg-eth1:
DEVICE=eth1
TYPE=Ethernet
BOOTPROTO=none
# change the hardware address to match the hardware address your NIC uses
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no
USERCTL=no
SLAVE=yes
MASTER=bond0

Edit or create /etc/sysconfig/network-scripts/ifcfg-bond0:
DEVICE=bond0
ONBOOT=yes
BONDING_OPTS='mode=1 miimon=100'
BRIDGE=br0
NM_CONTROLLED=no
BOOTPROTO=none

Edit or create /etc/sysconfig/network-scripts/ifcfg-br0:
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NM_CONTROLLED=no

Available bond mode:
balance-rr or 0
active-backup or 1
balance-xor or 2
broadcast or 3
802.3ad or 4
balance-tlb or 5
balance-alb or 6

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_network-bridge.html
http://www.linux-kvm.org/page/HOWTO_BONDING#Problem_with_Bridge_.2B_Bonding

Friday, January 15, 2016

Removing Build-in Application in Windows 10

Use PowerShell to Uninstall Built-in Apps

Uninstall 3D Builder:
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Uninstall Alarms and Clock:
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Uninstall Calculator:
Get-AppxPackage *windowscalculator* | Remove-AppxPackage
Uninstall Calendar and Mail:
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Uninstall Camera:
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Uninstall Contact Support:
This app can’t be removed.
Uninstall Cortana:
This app can’t be removed.
Uninstall Get Office:
Get-AppxPackage *officehub* | Remove-AppxPackage
Uninstall Get Skype:
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Uninstall Get Started:
Get-AppxPackage *getstarted* | Remove-AppxPackage
Uninstall Groove Music:
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Uninstall Maps:
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Uninstall Microsoft Edge:
This app can’t be removed.
Uninstall Microsoft Solitaire Collection:
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Uninstall Money:
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Uninstall Movies & TV:
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Uninstall News:
Get-AppxPackage *bingnews* | Remove-AppxPackage
Uninstall OneNote:
Get-AppxPackage *onenote* | Remove-AppxPackage
Uninstall People:
Get-AppxPackage *people* | Remove-AppxPackage
Uninstall Phone Companion:
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Uninstall Photos:
Get-AppxPackage *photos* | Remove-AppxPackage
Uninstall Store:
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Uninstall Sports:
Get-AppxPackage *bingsports* | Remove-AppxPackage
Uninstall Voice Recorder:
Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Uninstall Weather:
Get-AppxPackage *bingweather* | Remove-AppxPackage
Uninstall Windows Feedback:
This app can’t be removed.
Uninstall Xbox:
Get-AppxPackage *xboxapp* | Remove-AppxPackage

How to Reinstall All Built-in Apps

If you decide you want the preinstalled apps back, you can get them back with a single line of PowerShell code. Again, open a PowerShell window as Administrator. Copy and paste the following line into the PowerShell window and press Enter:
Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
This tells Windows to install those default apps again. Give it some time and allow it to finish, even if nothing appears to happen at first. Even if you see an error message, restart and examine your Start menu — you may just have all those default apps back again, anyway.

Source: http://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-apps-and-how-to-reinstall-them/

Debian Jessie KVM

Installasi:
# apt-get install qemu-kvm libvirt-bin virtinst bridge-utils
Grand user to manage:
# adduser dedetok kvm
# adduser dedetok libvirt
---------------------------------------------------
List all virtual
# virsh list --all
---------------------------------------------------
Default KVM with NAT
---------------------------------------------------
NAT Configuring default network
# virsh net-info default
# virsh net-autostart default
# virsh net-start default
---------------------------------------------------
KVM with bridge network
---------------------------------------------------
Setting up network using bridge
# brctl addbr br0
# ip addr show
# brctl addif br0 eth0
---------------------------------------------------
or write configuration permanently:
---------------------------------------------------
edit /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto eth0
#iface eth0 inet static
# address 192.168.1.10
# netmask 255.255.255.0
# gateway 192.168.1.1
iface eth0 inet manual
# Initial bridge for static
auto br0
iface br0 inet static
bridge_ports eth0
address 192.168.1.10
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1
bridge_stp off
bridge_fd 0
bridge-waitport 0
dns-nameservers 8.8.8.8
# Initial bridge for dhcp
#auto br0
#iface br0 inet dhcp
# bridge_ports eth0
iface br0 inet6 static
address 2001:db8::1
netmask 64
gateway fe80::1
autoconf 0
#iface br0 inet6 auto
---------------------------------------------------
additional interface option:
  • bridge_stp off # disable Spanning Tree Protocol
  • bridge_waitport 0 # no delay before a port becomes available
  • bridge_fd 0 # no forwarding delay
  • bridge_ports none # if you do not want to bind to any ports
  • bridge_ports regex eth* # use a regular expression to define ports
---------------------------------------------------
edit /etc/resolv.conf
nameserver 192.168.1.1
---------------------------------------------------
edit /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding=1
---------------------------------------------------
For performance and security reasons, disable netfilter for bridges. Edit /etc/sysctl.conf or create /etc/sysctl.d/bridge.conf with these contents:
net.bridge.bridge-nf-call-ip6tables=0
net.bridge.bridge-nf-call-iptables=0
net.bridge.bridge-nf-call-arptables=0
run
# sysctl -p
If you create /etc/sysctl.d/bridge.conf, then you need to create /etc/udev/rules.d/99-bridge.rules (If using Linux kernel 3.18 or later,
change KERNEL=="bridge" to KERNEL=="br_netfilter")
ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/sbin/sysctl -p /etc/sysctl.d/bridge.conf"
To allow all traffic to be forwarded across the bridge from KMV guest:
 -I Insert
# /sbin/iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
-P Policy
# iptables -P INPUT ACCEPT
Add default gateway (not necessary)
# route add default gw 192.168.1.1
---------------------------------------------------
network bonding and bridging
---------------------------------------------------
assuming server has 2 network interface eth0 and eth1.
# apt-get install bridge-utils ifenslave
edit /etc/network/interfaces:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual
iface eth1 inet manual
# Initial bridge for static
auto br0
iface br0 inet static
bridge_ports bond0
address 192.168.1.10
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1
bridge_stp off
bridge_fd 0
bridge-waitport 0
dns-nameservers 8.8.8.8
iface br0 inet6 auto
auto bond0
iface bond0 inet manual
slaves eth0 eth1
bond-mode 802.3ad
# bond_mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
Available bond mode:
  • balance-rr or 0
  • active-backup or 1
  • balance-xor or 2
  • broadcast or 3
  • 802.3ad or 4
  • balance-tlb or 5
  • balance-alb or 6
---------------------------------------------------
copy iso file into folder /var/lib/libvirt/boot/ (eq dsl-4.4.10.iso)
Create virtual machine: ram 256 with Storage 5G using NAT
# virt-install --name dsl01 --ram 256 --cdrom /var/lib/libvirt/boot/dsl-4.4.10.iso --disk path=/var/lib/libvirt/images/dl01.img,size=5 --network bridge=br0 --graphics none
Create virtual machine: ram 256 with Storage 5G using bridge
# virt-install --name dsl01 --ram 256 --cdrom /var/lib/libvirt/boot/dsl-4.4.10.iso --disk path=/var/lib/libvirt/images/dl01.img,size=5 --network bridge=br0 --graphics none
Create virtual machine ram 2G, virtual cpu 4 with disk image bridge virbr0 (NAT) using Debian network installer no graphics (using console)
# virt-install --virt-type kvm --name deb01 --location http://httpredir.debian.org/debian/dists/jessie/main/installer-amd64/ --extra-args "console=ttyS0" -v --disk path=/home/kvmimages/deb01/disk1.img --memory 2048 --vcpu 4 --network bridge:virbr0
Reference: