# Bring usb0 up automatically [SOLVED]

## pygoscelis

Hi everyone. I have a 3G cell phone which I use tethered as a USB network adapter. It works, but I have to bring it up manually each time it's plugged in:

```
sudo ifconfig usb0 up

sudo dhcpcd usb0

```

Sometimes dhcpcd doesn't work because there's an old instance of dhcpcd running on usb0. Sometimes in this case dhcpcd -n works, sometimes it does not and I have to kill the old instance.

What is the accepted way to do all this automatically? Do I need to create something like /etc/init.d/net.usb0 or something else? If it's etc/init.d/net.usb0, what do I put inside?

I'm not using NetworkManager.

UPD: heh, it always helps to look around a little.

What one needs to do is:

```
sudo emerge ifplugd

cd /etc/init.d

sudo ln -s net.lo net.usb0

```

Magic!

----------

## chithanh

ifplugd is totally not necessary. If /etc/init.d/net.usb0 exists then udev will launch it automatically as soon as you plug in the USB network device.

----------

## pygoscelis

 *chithanh wrote:*   

> ifplugd is totally not necessary. If /etc/init.d/net.usb0 exists then udev will launch it automatically as soon as you plug in the USB network device.

 

I tried without ifplugd and it didn't work. Maybe I just didn't have patience to wait for udev picking it up. Next time I'll try again.

----------

