Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bring usb0 up automatically [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Sun Nov 07, 2010 8:30 am    Post subject: Bring usb0 up automatically [SOLVED] Reply with quote

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:

Code:
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:
Code:
sudo emerge ifplugd
cd /etc/init.d
sudo ln -s net.lo net.usb0

Magic!
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Sun Nov 07, 2010 11:50 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Sun Nov 07, 2010 4:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum