1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
3 |
sudo ifconfig ath0 down |
if=eth1 |
4 |
#sudo dhclient eth0 |
test ! -z "$1" && if=$1 |
5 |
sudo ifconfig eth0 down |
|
6 |
|
echo "setting network on $if" |
7 |
|
#sudo ifconfig $if down || exit |
8 |
|
sudo killall udhcpd |
9 |
|
sudo rm etc/udhcpd.leases |
10 |
|
sudo touch etc/udhcpd.leases |
11 |
sleep 1 |
sleep 1 |
12 |
sudo ifconfig eth0 192.168.1.100 up |
sudo ifconfig $if 10.0.0.100 up |
13 |
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 |
#sudo ifconfig $if:192 192.168.1.241 netmask 255.255.255.240 up |
14 |
echo "leaving" |
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev $if |
|
sudo smcroute -l eth0 224.0.0.103 |
|
|
echo "joining" |
|
|
sudo smcroute -j eth0 224.0.0.103 |
|
15 |
netstat -rn |
netstat -rn |
16 |
|
pid=`pidof dhcpd` |
17 |
|
if [ -z "$pid" ] ; then |
18 |
|
echo "starting bootp server" |
19 |
|
sudo /usr/sbin/udhcpd etc/udhcpd.conf |
20 |
|
fi |
21 |
|
echo "starting tftp server" |
22 |
|
pid=`pidof in.tftpd` |
23 |
|
test ! -z "$pid" && sudo kill $pid |
24 |
|
sudo /usr/sbin/in.tftpd -l -a 10.0.0.100 -s /srv/tftp -B 1468 -v -v |