These quick steps will enable you to setup dial-up networking on Linux in just five minutes.
You need the following packages:
The steps below are for MS Windows NT RAS server. The NT RAS requires noauth in wvdial file. The Linux RAS may need different settings. In the sample example given below, you should replace username john with the user ID given to you to login into remote RAS server.
[Dialer myconnection] Username = john Password = passwordofjohn Phone = 982 1956 Area Code = 713 Inherits = Dialer Defaults Stupid mode = 1
# Secrets for authentication using PAP # client server secret IP addresses john ppp0 passwordofjohn john * passwordofjohn
# Secrets for authentication using CHAP # client server secret IP addresses john ppp0 passwordofjohn john * passwordofjohn
lock defaultroute noipdefault idle 1200 usepeerdns proxyarp
#!/bin/bash # This file /etc/ppp/ip-up should not be modified -- make local changes to # /etc/ppp/ip-up.local instead LOGDEVICE=$6 REALDEVICE=$1 export PATH=/sbin:/usr/sbin:/bin:/usr/bin [ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE} [ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@" exit 0
#!/bin/sh echo " " echo "Before doing route add......" echo "Output from netstat -nr is : " netstat -nr echo " " echo " Doing route add now.... " # You should change the lines below and add the networks where # your remote machines are ... route add -net 156.15.24.0 netmask 255.255.255.0 dev ppp0 route add -net 172.28.36.0 netmask 255.255.255.0 dev ppp0 route add -net 172.28.39.0 netmask 255.255.255.0 dev ppp0 route add -net 172.28.26.0 netmask 255.255.255.0 dev ppp0 echo "After doing route add......" echo "Output from netstat -nr is : " netstat -nr echo " "
bash$ su - root bash# route add -net 172.28.26.0 netmask 255.255.255.0 dev ppp0 bash# route del -net 172.23.2.0 netmask 255.255.255.0 dev ppp0
#!/bin/bash # This file /etc/ppp/ip-down should not be modified -- make local changes to # /etc/ppp/ip-down.local instead LOGDEVICE=$6 REALDEVICE=$1 export PATH=/sbin:/usr/sbin:/bin:/usr/bin [ -x /etc/ppp/ip-down.local ] && /etc/ppp/ip-down.local "$@" /etc/sysconfig/network-scripts/ifdown-post ifcfg-${LOGDEVICE} exit 0
#!/bin/sh echo " " echo "Before doing route delete ......" echo "Output from netstat -nr is : " netstat -nr echo " " echo " Doing route delete now.... " # Lines below should be same as in ip-up.local but with delete route del -net 156.15.24.0 netmask 255.255.255.0 dev ppp0 route del -net 172.28.36.0 netmask 255.255.255.0 dev ppp0 route del -net 172.23.2.0 netmask 255.255.255.0 dev ppp0 echo "After doing route delete ......" echo "Output from netstat -nr is : " netstat -nr echo " "
noauth user john name wvdial
bash$ su - root bash# tail -f /var/log/messages Bring up another xterm shell window and bash$ su - root bash# man pppd bash# man wvdial bash# cd /etc/ppp bash# nohup wvdial myconnection & bash# tail -f nohup.out Bring up another xterm shell window and bash$ su - root bash# ifconfig -a And you should see ppp device listed and up and running. bash# netstat -nr And you should see ppp device listed along with other interfaces.
bash$ su - root bash# tail -100 /var/log/messages | less bash# cat /etc/ppp/resolv.conf bash# ifconfig -a bash# netstat -nr I looked for route to network 156.15.24.0 (You should see your network as per /etc/ppp/ip-up.local) bash# ping 156.15.24.68 bash# telnet 156.15.24.68 You can also edit /etc/hosts and add these hosts 156.15.24.64 starship 172.28.36.131 gemstone bash# ping starship bash# ping gemstone bash# telnet gemstone bash# ftp gemstone
bash$ su - root bash# killall wvdial bash# killall pppd bash# man killall
bash$ su - root bash# su - someuser bash$ id uid=501(someuser) gid=501(maingid) groups=501(maingid),503(staroffice),505(staff) This shows the groups 'someuser' belongs. bash$ exit bash# usermod --help bash# usermod -g maingid -G staroffice,staff,uucp,dialout someuser bash# chgrp -R uucp /etc/ppp bash# chmod -R ug+r /etc/ppp bash# chmod -R o-rwx /etc/ppp bash# chmod go-rwx /etc/ppp/*secrets bash# chmod u+s /usr/sbin/pppd bash# su - someuser bash$ id This will display groups someuser belongs and you should see uucp. bash$ nohup wvdial myconnection & bash$ tail -f nohup.out
bash$ su - root bash# man route bash# ifconfig -a And look for the IP address of the ppp device, and use it below bash# route add default gw IP_of_ppp_device For example - bash# route add default gw 172.28.36.3
In case you have problems:
bash$ su - root bash# tail -f /var/log/messages And then start myconnection in /etc/wvdial.conf bash# wvdial myconnection bash# ifconfig -a Should list ppp bash# netstat -nr Should list ppp If you have multiple interfaces, like ethernet cards to DSL or Cable modem, to check which route is being used, do: bash# traceroute www.yahoo.com bash# traceroute remotehostname
Preference should be given the console line commands as in previous section, but some people prefer GUI interface. You can use graphical tools like Linuxconf, KPPP, GnomePPP and many others.
Note: I very strongly recommend using command-line console commands 'wvdial' as demonstrated in previous sections, as they are lot simpler and easy to use.
bash$ su - root bash# linuxconf & And select Networking->Client Tasks->Routing & Gateways->Set Other Routes to networks->Add network . Also select Networking->PPP bash# rp3 & bash# rp3-config &
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |