1
Linux Issues / problem with hotplugging
« on: May 25, 2004, 12:28:41 pm »
Well..I fixed my own problem. Using Debian unstable I install the hotplug .deb and the usb-utils .deb. I then compile the usbnet driver into a module so I could watch it load. In /etc/hotplug make a directory called usb and drop the follwing file in usb directory and call it usbnet.
#!/bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ] ; then
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
route add -host 192.168.129.201 usb0
fi
echo 1 ] /proc/sys/net/ipv4/ip_forward
#iptables -t filter -F FORWARD
#iptables -t filter -P FORWARD DROP
#iptables -t filter -A FORWARD -s $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT
#iptables -t filter -A FORWARD -d $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT
iptables -t nat -F PREROUTING
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -F OUTPUT
iptables -t nat -P OUTPUT ACCEPT
#!/bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ] ; then
ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
route add -host 192.168.129.201 usb0
fi
echo 1 ] /proc/sys/net/ipv4/ip_forward
#iptables -t filter -F FORWARD
#iptables -t filter -P FORWARD DROP
#iptables -t filter -A FORWARD -s $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT
#iptables -t filter -A FORWARD -d $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT
iptables -t nat -F PREROUTING
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -F OUTPUT
iptables -t nat -P OUTPUT ACCEPT