Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- MAC=`ifconfig eth0|grep HWaddr|awk '{print $5}'`
- for i in `echo $MAC|cut -d: -f3-|tr : ' '`; do
- [ -n "$IP" ] && IP=$IP.
- let c=0x$i
- IP=${IP}$c
- done
- GATEWAY=`echo $IP|cut -d. -f1-3`.1
- ifconfig eth0 $IP netmask 255.255.255.0
- route add default gw $GATEWAY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement