Difference between revisions of "USBNET Udev Rule"

From WebOS Internals
Jump to navigation Jump to search
(New page: If you use usbnet often to ssh into your Pre you probably are sick of assigning it an IP address every time you plug it in. By using a simple udev rule you can assign a static IP address a...)
 
 
Line 1: Line 1:
 
If you use usbnet often to ssh into your Pre you probably are sick of assigning it an IP address every time you plug it in. By using a simple udev rule you can assign a static IP address as soon as it is plugged in.
 
If you use usbnet often to ssh into your Pre you probably are sick of assigning it an IP address every time you plug it in. By using a simple udev rule you can assign a static IP address as soon as it is plugged in.
  
Create a file in /etc/udev/rules.d (ex. 01-palmpre.rules) and put the following line in it (obviously changing the mac address appropriately).
+
Create a file in /etc/udev/rules.d (ex. 01-palmpre.rules) and put the following line in it. You can set the IP address to what ever you want or even call dhcpcd instead of ifconfig.
  
 
<code>
 
<code>
KERNEL=="usb*", ATTR{address}=="d6:4b:6b:0c:a7:65", NAME="pre", RUN+="/sbin/ifconfig pre 192.168.0.200"
+
KERNEL=="usb*", ATTRS{product}=="Pre", NAME="pre", RUN+="/sbin/ifconfig pre 192.168.0.200"
 
</code>
 
</code>

Latest revision as of 22:45, 28 November 2009

If you use usbnet often to ssh into your Pre you probably are sick of assigning it an IP address every time you plug it in. By using a simple udev rule you can assign a static IP address as soon as it is plugged in.

Create a file in /etc/udev/rules.d (ex. 01-palmpre.rules) and put the following line in it. You can set the IP address to what ever you want or even call dhcpcd instead of ifconfig.

KERNEL=="usb*", ATTRS{product}=="Pre", NAME="pre", RUN+="/sbin/ifconfig pre 192.168.0.200"