LinuxDailup

From WeWeWeb Wiki
Jump to: navigation, search

Add a network interface (Private IP)

ifconfig eth0:0 netmask 255.255.255.0 192.168.10.50
route add -host 192.168.10.50 dev eth0:0

Add ipchains of masq

ipchains -A forward -s 192.168.10.0/24 -j MASQ

If you are using iptables (which is used to replace ipchains in the new Linux system), you don't need to create the interface eth0:0. Use the follow iptables rules:

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface ppp0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

In /etc/inittab, activate the serial line

S0:2345:respawn /sbin/mgetty ttyS0
S1:2345:respawn /sbin/mgetty ttyS1

Start from Fedora 9, the Upstart is used to replace SysVInit, so you can't put it in inittab. In /etc/event.d, create a file ttyS0 with the following content:

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5
start on started prefdm

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/mgetty -D ttyS0

To start the newly created service, use the command:

initctl start ttyS0

In /etc/ppp/options, add the following lines:

syncmap 0
netmask 255.255.255.0
proxyarp
lock
crtscts
modem
ms-dns 202.14.67.4
ms-dns 202.14.64.14

In /etc/ppp, add file options.ttyS0

login
require-pap
192.168.10.51:192.168.10.56

In /etc/ppp, add file options.ttyS1

login
require-pap
192.168.10.52:192.168.10.57

In /etc/ppp/pap-secrets

#client    server     secret    IP addresses
user1      *          ""        *
user2      *          ""        *

In /etc/ppp/chap-secrets, copy the contents of pap-secrets

Set sticky for /usr/sbin/pppd:-

chmod u+s /usr/sbin/pppd

In /etc/bashrc, add a line

alias ppp="exec /usr/sbin/pppd -detach"

To reset the inittab file

init q

To connect to modem use the program

minicom

To initialize the minicom, use the "-s" option


Goto Linux