I believe many of my friends know about the PPP protocol. Here we will explain the problem about Linux PPP settings. Now let's start with Linux dial-up Internet access. I hope this will help you. The details are as follows:
How to dial up Internet access in Linux PPP settings
Set PPP on a Linux server so that it can dial and connect to the ISP to connect the computer to the Internet. The following describes how to configure the Linux PPP client.
1. Compile the kernel to support PPP
In most cases, you do not need to recompile the kernel. If you cannot confirm whether or not Linux needs to be compiled, check the instructions and check whether the kernel supports PPP.
2. Set the serial port and Modem
1) serial device files
In Linux, the relationship between the names of serial port device files and DOS is as follows:
DOC COM1 = Linux/dev/cua0 (and/dev/ttyS0)
DOC COM2 = Linux/dev/cua1 (and/dev/ttyS1)
In general,/dev/cua * is used for dial-out, And/dev/ttyS * is used for dial-in. However, you can skip this step and use/dev/ttyS *. If there is no/dev/ttyS * on the computer, you need to use mknod to create these device files. There is a script program MAKEDEV to simplify this work:
# Cd/dev
#./MAKEDEV ttyS0
2) set the interrupt number and I/O address
On the Linux PPP client, run the following command to set the interrupt Number:
/Sbin/setserial/dev/ttyS0 ieq 3 # Serial mouse
/Sbin/setserial/dev/ttyS1 ieq 4 # MODEM1
Run the following command to view the interruption settings of the system to ensure that there is no interruption conflict:
Cat/proc/interrupts
The I/O address must be the same as the interrupt address. You can set a hardware jumper to change the I/O address. Generally, the I/O address of a serial port is as follows:
TtyS0 address 0x3f8
You can run the following command to view the system's I/O address settings to ensure that no conflict exists:
Cat/proc/ioports
3) set the modem
Generally, the factory settings of the modem do not need to be changed.
3. Understand ISP Information
You need to know some basic ISP information, especially the DNS address, and set your own DNS. For Linux, it cannot dynamically specify the dns ip address when connecting lines.
4. install the software required for dialing in Linux PPP settings
The programs required by PPP customers include chat and pppd. There is also a terminal communication program, minicom, which is used to test dial-up. It must also be installed.
The purpose of the chat program is to dial and wait for a prompt. Enter the user name, password, and Other Logon Information as prompted. Pppd is used to establish and maintain PPP connections with servers and transmit data.
5. Establish a ppp connection manually
The entire ppp connection can be divided into two steps:
1) Use pppd to establish a ppp connection
Test whether the dial-up is successful. Exit and run the pppd program as follows:
Pppd debug lock Modem crtscts defaultroute/dev/ttyS1 115200 &
Run the following code on a separate virtual console:
Tail-f/var/log/messages
Dynamically observe various log information, including the debugging information of pppd. If the following information is displayed, the PPP connection is successful:
Jun23 16: 10: 31hxf pppd [1234]: local IP address210.88.131.151
Jun23 16: 10: 31hxf pppd [1234]: remote IP address192.168.10.21
2) disconnect
After the test is passed, you need to disconnect the connection and use the following command:
Killall pppd
6. Automate PPP connections
After the manual connection test, you need to turn this into automatic, in order to achieve dial-up connections with only one command.
To automate dialing, two programs are required: chat and pppd. For the effect of automatic dialing, you can view the relevant information.
7. Set domain name resolution (DNS)
In Linux, it is not convenient to set up domain name resolution for PPP, And the Domain Name Server needs to be set by itself.
1) set the Domain Name Server
The/ect/resolv. conf file stores the Domain Name Server address, and its content is as follows:
Domain your. isp. domain. name
Nameserver202.106.196.152
Nameserver202.106.196.115
You need to fill in the ISP domain name server address in this file.
2) Automation
You may only need to add the Domain Name Server address when dialing. This is not required for other times. Therefore, you can also automate this process in addition to manual configuration. You can create two script files for execution in/etc/ppp/ip-up.local and/etc/ppp/ip-down.local. After pppd is started, the command in/etc/ppp/ip-up.local is executed; When pppd ends, the command in/etc/ppp/ip-down.local is executed. You can make a file that contains the Domain Name Server, change it to/etc/resolv. conf in the ip-up.local, and save/etc/resolv. conf. Restore the saved/etc/resolv. conf in the ip-down.local. In this way, you can automatically add domain name servers.
Linux PPP settings set the dial-in server in the LAN
The purpose of configuring the dial-in server in the LAN is to set the Linux LAN to the same dial-up server as the ISP. Assume that you have set up a dial-up server in Linux, and then connect to the company's dial-up server at home to access the company's lan. In this way, you can achieve "Home Office ". If your company's servers are connected to the Internet, you can browse the Internet. "Setting basic dial-up servers" will tell you how to implement this function. "Callback" describes how to save the telephone fee required for networking.