ifconfig with "plumb" and "unplumb"
Solaris introduced me to "plumbing" an interface. I'm not sure if you
do this on other OS's, but you do it in Solaris. Here you are:
1) bring an interface down:
ifconfig ce0 down
2) take an interface offline:
ifconfig ce0 unplumb
3) bring an interface online:
ifconfig ce1 plumb
4) configure the interface and bring it up:
ifconfig ce1 10.2.2.190 netmask + broadcast + up
In
number 4, the "netmask +" entry reads from the longest matching entry
in /etc/netmasks and populates it. You could also put your own entry
in.
The "broadcast +" tells ifconfig to use a reasonable broadcast
address - namely, it populates the last octet with all 1's (255). You
could also put your own entry in, but I recommend against it. You could
end up with an almost impossible problem to figure out, because the
wrong broadcast address will cause all those arps and rarps and icmp
chatter between your server and the router to fail. I learned this last
bit on an interview