Sunday, June 27, 2010

Easy way to set up dial-up in Gentoo (+- Xfce)

It's based on Gentoo Wiki Archives - Dial-up with some additions. Look here to learn how to enable support for your modem in the kernel. This article is for serial modems.I'm going to use wvdial, because using ppp directly in Gentoo(in Ubuntu it's OK) requires much work.
1. Install wvdial:
  Run in termial:
    $ su
    Password: (enter your root password)
    # emerge -avt wvdial (-avt is --ask --verbose --tree)
    (you know what next:))
2. Add non-root users that need to connect by dial-up to the dialout group:
  Run in terminal:
    # gpasswd -a [user] dialout
3. Configure wvdial:
  1. Turn on your modem
  2. Run in terminal:
    # wvdialconf /etc/wvdial.conf
    (wvdial will probe your serial(COM in Win) ports and your modem)
  3. Edit the configuration file(/etc/wvdial.conf):
    Uncomment "Username =", "Password =" and "Phone =" and change it. If you have pulse dialing(not tone), add P in front of the phone number(ex. P8w600100). You can know if you have tone dialing when you dial with your phone and it sounds like this: DTMF Dialing.ogg.
    It's safe not to touch Baud.
  4. My configuration file as an example:
    http://dpaste.org/aOKB/
4. Now you can try to connect:
  Run in terminal:
    # wvdial
  If you see something like this: http://dpaste.org/CaNU/ then it has connected. You can try it in your browser.
    Press Ctrl+C to disconnect.
5. Set it up that non-root users may connect:
  1. Edit sudo configuration file:
    Run in terminal:
      # visudo
    Add these lines:

%dialout        ALL=(root) NOPASSWD: /usr/bin/wvdial
%dialout        ALL=(root) NOPASSWD: /usr/bin/killall wvdial

  2. For example here is my sudo configuration file:
    http://dpaste.org/LAx0/
  2. You can connect as normal user with this command:
    sudo wvdial
  Disconnect:
    sudo killall wvdial
  Or by pressing Ctrl+C if you run the connect command in terminal.
  3. If you are not using Xfce or planning to connect from the command line(but not from the Xfce panel) you can make it easier:
    1. Edit your ~/.bashrc:
      Add this line:

alias wvdial='sudo wvdial' dialup_hangup='sudo killall wvdial'

      You can replace wvdial and dialup_hangup with anything you like.
    2. Now you can connect and disconnect with these commands(wvdial and dialup_hangup)
6. Optional: Enable connection from Xfce panel:
  1. Install(if you don't have it) xfce4-modemlights-plugin:
    Run in terminal:
      $ su
      Password: (enter your root password)
      # emerge -avt xfce4-modemlights-plugin
    It will be masked, so you must unmask it:
      Edit /etc/portage/package.keywords:
        Add this line:

xfce-extra/xfce4-modemlights-plugin

  2. Add "Modem Lights" to your panel:
    Right-click on the panel, choose "+ Add new items..." and choose "Modem Lights"
  3. Configure Modem Lights plugin:
    Connection Command: /usr/bin/sudo wvdial
    Disconnection Command: /usr/bin/sudo killall wvdial
    For Device and Lockfile read the plugin's help: click "(i)"
  4. You can connect and disconnect by clicking on the phone icon.

No comments:

Post a Comment