http://docs.oracle.com/cd/E17904_01/core.1111/e12036/server_migration.htm
https://forums.oracle.com/forums/thread.jspa?messageID=4331554
more in this other post
in $DOMAIN_HOME/bin/server_migration there is this little script "wlsifconfig.sh", who is involved in the Virtual IP migration process - the core of the Server Migration really.
I have opened to see what it does.
There are 3 functions: listif(), removeif(), addif() (where if=network interface)
listif() does a "/sbin/ip -o addr", whose output is a bit intimidating:
1: lo:
1: lo inet 127.0.0.1/8 scope host lo
1: lo inet6 ::1/128 scope host \ valid_lft forever preferred_lft foreve r
2: eth0:
2: eth0 inet 10.10.10.10/32 brd 10.10.10.10 scope global eth0
3: eth1:
4: sit0:
5: bond0:
5: bond0 inet 120.56.5.189/24 brd 10.56.5.255 scope global bond0
5: bond0 inet 120.56.5.183/24 brd 10.56.5.255 scope global secondary bond0:0
5: bond0 inet 120.56.5.182/24 brd 10.56.5.255 scope global secondary bond0:1
5: bond0 inet6 fe80::9e8a:99ff:fea7:6c90/64 scope link \ valid_lft fore ver preferred_lft forever
basically for every nic it gives you all info on its configuration (one day maybe I will understand all this)
The other command is
/sbin/ip -o addr | sed -n 's?.*inet \([0-9.]*\)\/[0-9]* .* \([^ ]*\)?\2 \1?p'
which gives a much more human output, the list of each NIC and its associated IP:
lo 127.0.0.1
eth0 10.10.10.10
bond0 10.56.5.189
bond0:0 10.56.5.183
bond0:1 10.56.5.182
The other function removeif() does a
ifconfig "ipaddress" down
ifconfig "ipaddress" 0.0.0.0
Finally addif() essentially does a
sudo /sbin/ifconfig (some parameter) up
interesting is also the Address Resolution Protocol PING:
/sbin/arping
it needs sudo, example:
sudo /sbin/arping 11.61.286.232
http://en.wikipedia.org/wiki/Arping
Anyway shell scripting is so cryptic that it hurts the eyes.
No comments:
Post a Comment