Home | Mirror | Search

2. IP / Mac Address

2.1. IP Address

nmap -sP 172.16.1.0/24
			

2.2. Mac Address

nmap -sP -PI -PT -oN ipandmaclist.txt 172.16.1.0/24
			

2.3. NIC

DEVICE=eth0
BOOTPROTO=static
HWADDR=00:15:17:3E:90:90
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=172.16.1.26
GATEWAY=172.16.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
			

2.4. DNS

			
echo -ne "
search example.com
nameserver 208.67.222.222
nameserver 202.67.220.220
nameserver 8.8.8.8
nameserver 4.4.4.4
" > /etc/resolv.conf
			
			

2.5. bonding

http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/bonding.txt

http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding

http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/

			
cat >> /etc/modprobe.d/bonding.conf <<EOF
alias bond0 bonding
options bond0 miimon=100 mode=1  primary=eth0
alias bond1 bonding
options bond1 miimon=100 mode=1  primary=eth2
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth2 <<EOF
DEVICE=eth2
ONBOOT=yes
MASTER=bond1
SLAVE=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth3 <<EOF
DEVICE=eth3
ONBOOT=yes
MASTER=bond1
SLAVE=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-bond0 <<EOF
DEVICE=bond0
ONBOOT=yes
IPADDR=192.168.80.1
NETMASK=255.255.255.0
NETWORK=192.168.80.0
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-bond1 <<EOF
DEVICE=bond1
ONBOOT=yes
IPADDR=192.168.80.2
NETMASK=255.255.255.0
NETWORK=192.168.80.0
BOOTPROTO=none
USERCTL=no
EOF
			
			
			
cp /etc/sysconfig/network-scripts/ifcfg-eth0{,.original}

cat >> /etc/modprobe.d/bonding.conf <<EOF
alias bond0 bonding
options bond0 mode=balance-alb miimon=1000
EOF

cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
EOF

cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth2 <<EOF
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-eth3 <<EOF
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
EOF

cat >> /etc/sysconfig/network-scripts/ifcfg-bond0 <<EOF
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
IPADDR=192.168.80.65
NETMASK=255.255.255.0
NETWORK=192.168.80.0
USERCTL=no
EOF
			
			
			
modprobe bonding mode=balance-alb miimon=1000
ifconfig bond0 up
ifconfig bond0 192.168.80.1 netmask 255.255.255.0 up
ifenslave bond0 eth0
ifenslave bond0 eth1

echo 1000 > /sys/class/net/bond0/bonding/miimon
echo 6 > /sys/class/net/bond0/bonding/mode
echo balance-alb > /sys/class/net/bond0/bonding/mode


BONDING_OPTS="mode=1 miimon=100"

echo balance-rr >/sys/class/net/bond0/bonding/mode
modprobe bonding mode=balance-tlb miimon=1000

ifenslave -d bond0 eth0 eth1
ifenslave bond1 eth2 eth3
			
			
# ethtool eth0
Settings for eth0:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: Unknown
	Supports Wake-on: g
	Wake-on: d
	Link detected: yes

# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: None
MII Status: down
MII Polling Interval (ms): 1000
Up Delay (ms): 0
Down Delay (ms): 0

[root@r610 ~]# ifconfig bond0 up
[root@r610 ~]# ifenslave bond0 eth0 eth2

# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 1000
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 14:fe:b5:dc:30:ee

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 14:fe:b5:dc:30:f0

[root@r610 network-scripts]# cat /sys/class/net/bond0/bonding/miimon
1000
[root@r610 network-scripts]# cat /sys/class/net/bonding_masters
bond0
[root@r610 network-scripts]# cat /sys/class/net/bond0/bonding/mode
balance-alb 6

	        
comments powered by Disqus