Create ad-hoc network
iwconfig wlan0 mode ad-hoc essid "yourssid"
Specify IP
ifconfig wlan0 10.0.0.1 netmask 255.0.0.0 up
Tuesday, July 31, 2012
Monday, July 30, 2012
Linux Ethernet Bonding
Set NICs as slaves
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.0.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
vi /etc/modprobe.conf
alias bond0 bonding
option bond0 miimon=100 mode=3
mode Description
balance-rr or 0 Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
active-backup or 1 Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch.
balance-xor or 2 XOR policy: Transmit based on the selected transmit hash policy. The default policy is a simple
balance-tlb or 5 Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.
balance-alb or 6 Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.0.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
vi /etc/modprobe.conf
alias bond0 bonding
option bond0 miimon=100 mode=3
mode Description
balance-rr or 0 Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
active-backup or 1 Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch.
balance-xor or 2 XOR policy: Transmit based on the selected transmit hash policy. The default policy is a simple
- broadcast or 3
- Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.
- 802.3ad or 4
- IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.
balance-tlb or 5 Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.
balance-alb or 6 Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation.
Create Custom Linux Initrd
Extract from Initrd
gunzip < initrd.img | cpio -i --make-directories
Create Initrd
find ./ | cpio -H newc -o > initrd.cpio
gzip initrd.cpio
mv initrd.cpio.gz initrd.img
Create Initrd from System Folder
mkinitrd /boot/initrd.$(uname -r).img $(uname -r)
gunzip < initrd.img | cpio -i --make-directories
Create Initrd
find ./ | cpio -H newc -o > initrd.cpio
gzip initrd.cpio
mv initrd.cpio.gz initrd.img
Create Initrd from System Folder
mkinitrd /boot/initrd.$(uname -r).img $(uname -r)
Install Chewing Input Method
yum install ibus ibus-chewing
Windows and Linux Spoof MAC Address
Linux
ifconfig eth0 hw ether 00:11:22:33:44:55
Windows
Registry
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0008]
"NetworkAddress"="001122334455"
or GUI
Start/Settings/Network Connections/Local Area Connection
Properties/Configure ...
Advanced
Advanced (Another example)
ifconfig eth0 hw ether 00:11:22:33:44:55
Windows
Registry
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0008]
"NetworkAddress"="001122334455"
or GUI
Start/Settings/Network Connections/Local Area Connection
Properties/Configure ...
Advanced
Advanced (Another example)
grub2 Recovery
Set target Linux partition as root
root=(hd0,6)
(You may list content of the root)
ls /
Specify kernel file and Linux root
linux /boot/vmlinuz root=/dev/sda6
Specify initial RAM disk
initrd /boot/initrd
Boot
boot
root=(hd0,6)
(You may list content of the root)
ls /
Specify kernel file and Linux root
linux /boot/vmlinuz root=/dev/sda6
Specify initial RAM disk
initrd /boot/initrd
Boot
boot
Sunday, July 22, 2012
WiMAX Connection
Install
yum install wimax
Run Service
wimaxd
Turn Radio
wimaxcu ron
Scan Network (and Get Network ID)
wimaxcu scan
Connect Network
wimaxcu connect network 16205833
Obtain IP
dhclient wmx0
Disconnect Network
wimaxcu dconnect
yum install wimax
Run Service
wimaxd
Turn Radio
wimaxcu ron
Scan Network (and Get Network ID)
wimaxcu scan
Connect Network
wimaxcu connect network 16205833
Obtain IP
dhclient wmx0
Disconnect Network
wimaxcu dconnect
Saturday, July 21, 2012
Linux Sleep and Hibernate Command
Suspend to Disk (Hibernate)
echo -n "disk" > /sys/power/state
or
echo -n "mem" > /sys/power/state
or
echo -n "disk" > /sys/power/state
or
pm-hibernateSuspend to RAM (Sleep)
echo -n "mem" > /sys/power/state
or
pm-suspend
Subscribe to:
Posts (Atom)