How to configure a point-to-point (PPP) Dial-Up server in Red Hat Enterprise Linux

Source: Internet
Author: User
Tags root access
How to configure a point-to-point (PPP) Dial-Up server-Linux Enterprise Application-Linux server application information in Red Hat Enterprise Edition Linux is described below. Due to the use of Internet broadband connections, the dial-up modem is outdated, but there are still some situations that require dial-up access. a ppp server in the Office provides another method for users to access email and Internet when they are on a business trip. when a server or network problem occurs, the dial-up modem also provides an emergency connection for the system administrator. the following describes how to configure a PPP server to allow remote access by the system administrator when using the Red Hat Enterprise Linux, Microsoft Windows, OS X, or other operating systems that support PPP dialing. on the remote client's dialing software, you only need to enter the modem's phone number, user name, and password. On the client side, no additional configurations are required for Red Hat Enterprise Linux and other operating systems.

Follow these steps to configure your PPP Server:

1. In the/etc/mgetty + sendfax/login. config file, remove the comment of the row where 'autoppp 'is located:

/AutoPPP/-a_ppp/usr/sbin/pppd auth-chap + pap login debug

2. Adjust the port speed in the/etc/mgetty + sendfax/mgetty. config file to match the modem parameters.

Speed57600

3. Add the following lines to the/etc/inittab file:

Ppp0: 345: respawn:/sbin/mgetty-x 3 ttyS0

Change ttyS0 (ttyS0 is the first serial port) to the port connecting to the modem. each modem requires one line. if multiple modems are used, each modem requires a unique terminal name (ppp0 here is the name), and ttyS0 needs to be changed to an appropriate serial port. if you are not sure which port the modem is connected to, use the following port query command:

Wvdialconf/tmp/wvdialtest. conf

The output of this command will show which port the modem connects to. The display is similar:

"Found a modem on/dev/ttyS0, using link/dev/modem in config"

4. add the following content to the/etc/ppp/options file. do not forget to delete any existing options in this file and add the real DNS server to the row where ms-dns is located:

# Don't fork to become a background process (otherwise pppd will do so
# If a serial device is specified ).
-Detach

# Async character map -- 32-bit hex; each bit is a character
# That needs to be escaped for pppd to receive it. 0 x0 00000001
# Represents '\ x01', and 0x80000000 represents '\ x1f '.
Asyncmap 0

# Set the interface netmask to, a 32 bit netmask in "decimal dot"
# Notation (e.g. 255.255.255.0 ).
Netmask 255.255.255.0

# Add an entry to this system's ARP [Address Resolution Protocol]
# Table with the IP address of the peer and the Ethernet address of this
# System.
Proxyarp

# Specifies that pppd shoshould use a UUCP-style lock on the serial device
# To ensure exclusive access to the device.
Lock

# Use hardware flow control (I. e. RTS/CTS) to control the flow of data
# On the serial port.
Crtscts

# Use the modem control lines. On Ultrix, this option implies hardware
# Flow control, as for the crtscts option. (This option is not fully
# Implemented .)
Modem

# This machine does not authenticate callers
Noauth

# Set DNS servers. Replace aa. bb. cc. dd and ee. ff. gg. hh with the actual
# DNS servers for your environment.
Ms-dns aa. bb. cc. dd
Ms-dns ee. ff. gg. hh

5. create a/etc/ppp/options. ttySX file, where ttySX is the serial port connected by the modem (similar to ttyS0 or ttyS1 ). in this file, add the IP address configured as the IP address of the PPP server. The semicolon is followed by the IP address assigned to the modem. this file looks similar:

# Server_IP_address: Client_IP_address
192.168.1.68: 192.168.1.107

This sets the IP address of the Gateway (the IP address of the PPP server) and the IP address of the remote machine. create a file for each modem. the IP addresses of each PPP server may be the same, but each modem needs its own unique IP address.

6. Set the suid bit for root access for the pppd program:

Chmod u + s/usr/sbin/pppd

This causes pppd to run as root.

7. Use the init q command to re-read the/etc/inittab File

8. Activate IP forwarding to route customer requests outside the server:

Echo 1>/proc/sys/net/ipv4/ip_forward

If you want this setting to take effect after restart and permanently, You can edit the/etc/sysctl. conf file and add the following lines:

Net. ipv4.ip _ forward = 1

9. the user account needs to be changed during logon to automatically run the/usr/sbin/pppd program. if this is not set, you need to manually execute pppd in a terminal window after logging on. although a general 'ppuser' account can be used by anyone, we strongly recommend that you create a separate account for security reasons. create an account for ppp. You can use the useradd command to create an account. after passwd is used to set a password for this user, modify the/etc/passwd file and change the logon shell of this account to/usr/sbin/pppd. the rows in/etc/passwd are similar to the following:

Bob: x: 500: 500: bob:/home/bob:/usr/sbin/pppd

10. red Hat Enterprise Linux supports PAP verification and CHAP verification. For CHAP scripts on the client and server, a simple PAP verification method is used here. PAP is passed in/etc/mgetty + sendfax/login. the AutoPPP row in the config file specifies the-chap + pap parameter. to allow user authentication, edit the/etc/ppp/pap-secrets file, including the user name and password. these usernames and passwords are the same as the usernames you use to log on to the system from your local terminal. for example, if we want to authorize PPP to access a user with the "bob" and password "mypassword", the file looks as follows:

# UserServerSecretIP Address
Bob * mypassword *

The * number under the asterisks under The Server and IP address allows the user to log on to The Server from any IP address.

Troubleshooting when the user is dial in, the modem does not automatically answer, make sure that the DIP switch on the modem is not configured to force Automatic Answer. you do not need to reconfigure the modem in the default settings to make the PPP work.

If the modem replies but the user cannot log on, use the tail-f command to monitor/var/log/messages and/var/log/mgetty. log. ttySX (X is your serial number) to get the error message.

Confirm that the user's logon password is the same as the password in etc/ppp/pap-secrets, and that the password entered in the dial-up software is also matched.

If the error is similar to init chat failed, exiting...: Invalid argument appears in/var/log/mgetty. log. in the ttySX file, the initialization string of the modem may be incorrect. to modify this error, add the following rows to/etc/ppp/mgetty. in the config file:

Init-chat "" atz OK at & F1 OK

Replace AT & F1 with the corresponding initialization string of your modem. AT & F1 should be suitable for US Robotics modem because it loads factory default configurations.

Note: When shi is using the most remote client in Linux,/var/log/mgetty. log. the 'USER' area of the ttySX file displays the username that is actually logged on. if Windows is a remote client operating system, '/AutoPPP/' is displayed in the 'USER' area /'. this is normal.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.