Patch allows using iproute2 instead of net-tools (ifconfig and route) Hadzhimurad Ustarkhanov [ hmurad dot ust at gmail dot com ] diff -Naur rp-pppoe-3.10-orig/doc/HOW-TO-CONNECT rp-pppoe-3.10/doc/HOW-TO-CONNECT --- rp-pppoe-3.10-orig/doc/HOW-TO-CONNECT 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/doc/HOW-TO-CONNECT 2011-09-05 07:13:37.000000000 +1200 @@ -21,14 +21,15 @@ of this document. However, if the card is the only Ethernet card in the system, executing: - ifconfig eth0 + ip link show eth0 should display something like this: - eth0 Link encap:Ethernet HWaddr 00:60:67:62:31:D4 + 3: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 + link/ether 00:10:b5:d1:ea:fc brd ff:ff:ff:ff:ff:ff -plust some more lines. Your HWaddr will be different. As long as you see -the HWaddr line, your card should be working. +Your second line will most definately be different. As long as you see +the link/ether line, your card should be working. DO NOT assign an IP address to the Ethernet card. DO NOT configure the card to come up at boot time. @@ -119,7 +120,7 @@ If you want to manually configure the LAN hosts, here's how: -In Linux, use: "ifconfig eth0 mtu 1452". For best results, put this +In Linux, use: "ip link set eth0 mtu 1452". For best results, put this in an /etc/rc.d/rc.local script. For Windows, machines, see http://lan.cns.ksu.edu/OS/WIN95/slip95.htm. @@ -147,9 +148,9 @@ Well, I can't really help you here. To use these instructions, you must have Linux working to the point where it recognizes your Ethernet card. -If you type "ifconfig ethx" and you get back a HWAddr value, your Ethernet -card is probably OK. But I really can't help with hardware configuration -issues. +If you type "ip link show ethx" and you get back a hardware address value +in the line that begins with link/ether, your Ethernet card is probably OK. +But I really can't help with hardware configuration issues. ----------------------------------------------------------------------------- B) Connection seems to come up, but I can't browse the web or ping anything @@ -224,9 +225,9 @@ address. For example, if eth0 is your internal LAN card and eth1 goes to the DSL modem, do something like this: - ifconfig eth1 10.0.0.1 netmask 255.255.255.0 + ip link set eth1 10.0.0.1/24 -(You may have to choose a different IP address; experiment.) +(You may have to choose a different IP address and prefix; experiment.) ----------------------------------------------------------------------------- K) How can I run a script every time I connect and get a new IP address? @@ -262,7 +263,7 @@ connected to the DSL modem. You might want to add these lines in pppoe-connect: - ifconfig ethx down - ifconfig ethx up mtu 1500 + ip link set ethx down + ip link set ethx up mtu 1500 which should reset things to sane values. diff -Naur rp-pppoe-3.10-orig/gui/tkpppoe.in rp-pppoe-3.10/gui/tkpppoe.in --- rp-pppoe-3.10-orig/gui/tkpppoe.in 2008-07-01 02:00:41.000000000 +1200 +++ rp-pppoe-3.10/gui/tkpppoe.in 2011-09-05 07:24:42.000000000 +1200 @@ -1573,7 +1573,7 @@ #*********************************************************************** proc GetEthernetInterfaces {} { set ifs {} - set fp [open "|/sbin/ifconfig" "r"] + set fp [open "|/sbin/ip" "r"] while {[gets $fp line] >= 0} { if {[regexp {^eth[0-9]+} $line eth]} { lappend ifs $eth diff -Naur rp-pppoe-3.10-orig/man/pppoe-sniff.8 rp-pppoe-3.10/man/pppoe-sniff.8 --- rp-pppoe-3.10-orig/man/pppoe-sniff.8 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/man/pppoe-sniff.8 2011-09-05 07:16:01.000000000 +1200 @@ -31,7 +31,7 @@ for example, type these commands: .nf - ifconfig eth0 promisc + ip link set eth0 promisc on pppoe-sniff -I eth0 .fi @@ -48,7 +48,7 @@ remember to turn off promiscuous mode: .nf - ifconfig eth0 -promisc + ip link set eth0 promisc on .fi .SH OPTIONS diff -Naur rp-pppoe-3.10-orig/scripts/pppoe-connect.in rp-pppoe-3.10/scripts/pppoe-connect.in --- rp-pppoe-3.10-orig/scripts/pppoe-connect.in 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/scripts/pppoe-connect.in 2011-09-05 07:26:41.000000000 +1200 @@ -28,7 +28,7 @@ localstatedir=/var # Paths to programs -IFCONFIG=/sbin/ifconfig +IPBIN=/sbin/ip PPPD=@PPPD@ SETSID=@SETSID@ PPPOE=@sbindir@/pppoe @@ -115,7 +115,7 @@ # fails on some *BSD's, so we'll only do it under Linux if test `uname -s` = Linux ; then - $IFCONFIG $ETH up mtu 1500 + $IPBIN link set $ETH up mtu 1500 # For 2.4 kernels. Will fail on 2.2.x, but who cares? modprobe ppp_generic > /dev/null 2>&1 modprobe ppp_async > /dev/null 2>&1 diff -Naur rp-pppoe-3.10-orig/scripts/pppoe-setup.in rp-pppoe-3.10/scripts/pppoe-setup.in --- rp-pppoe-3.10-orig/scripts/pppoe-setup.in 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/scripts/pppoe-setup.in 2011-09-05 07:17:51.000000000 +1200 @@ -17,7 +17,7 @@ exec_prefix=@exec_prefix@ # Paths to programs -IFCONFIG=/sbin/ifconfig +IPBIN=/sbin/ip PPPD=@PPPD@ PPPOE=@sbindir@/pppoe ECHO=@ECHO@ @@ -94,7 +94,7 @@ # Under Linux, "fix" the default interface if eth1 is not available if test `uname -s` = "Linux" ; then - $IFCONFIG $ETH > /dev/null 2>&1 || ETH=eth0 + $IPBIN link show $ETH > /dev/null 2>&1 || ETH=eth0 fi $ECHO "" $ECHO "INTERFACE" diff -Naur rp-pppoe-3.10-orig/scripts/pppoe-start.in rp-pppoe-3.10/scripts/pppoe-start.in --- rp-pppoe-3.10-orig/scripts/pppoe-start.in 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/scripts/pppoe-start.in 2011-09-05 07:19:54.000000000 +1200 @@ -29,7 +29,7 @@ # Paths to programs CONNECT=@sbindir@/pppoe-connect ECHO=@ECHO@ -IFCONFIG=/sbin/ifconfig +IPBIN=/sbin/ip # Set to "C" locale so we can parse messages from commands LANG=C @@ -69,8 +69,9 @@ $ECHO "* interfaces. The one you chose for PPPoE should contain the words:" >> $DEBUG $ECHO "* 'UP' and 'RUNNING'. If it does not, you probably have an Ethernet" >> $DEBUG $ECHO "* driver problem." >> $DEBUG - $ECHO "Output of ifconfig -a" >> $DEBUG - $IFCONFIG -a >> $DEBUG + $ECHO "Output of 'ip link show'" >> $DEBUG + $IPBIN link show >> $DEBUG + $ECHO "---------------------------------------------" >> $DEBUG if [ "`uname -s`" = "Linux" ] ; then $ECHO "* The following section contains information about kernel modules" >> $DEBUG @@ -85,8 +86,8 @@ $ECHO "* have defined a default route and gateway, and pppd will" >> $DEBUG $ECHO "* not create a default route using your ISP. Try getting" >> $DEBUG $ECHO "* rid of this route." >> $DEBUG - $ECHO "Output of netstat -n -r" >> $DEBUG - netstat -n -r >> $DEBUG + $ECHO "Output of ip route" >> $DEBUG + $IPBIN route >> $DEBUG $ECHO "---------------------------------------------" >> $DEBUG $ECHO "Contents of /etc/resolv.conf" >> $DEBUG $ECHO "* The following section lists DNS setup." >> $DEBUG diff -Naur rp-pppoe-3.10-orig/scripts/pppoe-status rp-pppoe-3.10/scripts/pppoe-status --- rp-pppoe-3.10-orig/scripts/pppoe-status 2008-07-01 02:00:42.000000000 +1200 +++ rp-pppoe-3.10/scripts/pppoe-status 2011-09-05 07:22:16.000000000 +1200 @@ -66,14 +66,14 @@ PID=`cat $i` if [ "$PID" = "$PPPD_PID" ] ; then IF=`basename $i .pid` - netstat -rn | grep " ${IF}\$" > /dev/null - # /sbin/ifconfig $IF | grep "UP.*POINTOPOINT" > /dev/null + ip route | grep "dev ${IF}" > /dev/null + # /sbin/ip link show $IF | grep "UP.*POINTOPOINT" > /dev/null if [ "$?" != "0" ] ; then echo "pppoe-status: Link is attached to $IF, but $IF is down" exit 1 fi echo "pppoe-status: Link is up and running on interface $IF" - /sbin/ifconfig $IF + /sbin/ip link show $IF exit 0 fi fi @@ -81,4 +81,3 @@ echo "pppoe-status: Link is down -- could not find interface corresponding to" echo "pppd pid $PPPD_PID" -exit 1 \ No newline at end of file diff -Naur rp-pppoe-3.10-orig/src/libevent/Makefile rp-pppoe-3.10/src/libevent/Makefile --- rp-pppoe-3.10-orig/src/libevent/Makefile 1970-01-01 12:00:00.000000000 +1200 +++ rp-pppoe-3.10/src/libevent/Makefile 2011-09-05 06:36:12.000000000 +1200 @@ -0,0 +1,42 @@ +# Generated automatically from Makefile.in by configure. +# $Id$ +# +# Makefile for event-handling library +# +# Copyright 2002 Roaring Penguin Software Inc. +# +# This software may be distributed according to the terms of the GNU +# General Public License, version 2 or (at your option) any later version. +# LIC: GPL + +OBJS=event.o event_tcp.o hash.o event_sig.o +SRCS=$(OBJS:.o=.c) +HDRS=event.h event_tcp.h eventpriv.h hash.h +CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -Wstrict-prototypes -I.. $(DEFINES) +AR=ar + +all: libevent.a + +libevent.a: $(OBJS) + rm -f libevent.a + $(AR) -cq libevent.a $(OBJS) + ranlib libevent.a + +event.o: event.c $(HDRS) + gcc $(CFLAGS) -c -o event.o event.c + +hash.o: hash.c $(HDRS) + gcc $(CFLAGS) -c -o hash.o hash.c + +event_sig.o: event_sig.c $(HDRS) + gcc $(CFLAGS) -c -o event_sig.o event_sig.c + +event_tcp.o: event_tcp.c $(HDRS) + gcc $(CFLAGS) -c -o event_tcp.o event_tcp.c + +clean: FORCE + rm -f *.a *.o *~ + +FORCE: + +.phony: FORCE \ No newline at end of file diff -Naur rp-pppoe-3.10-orig/src/pppoe-sniff.c rp-pppoe-3.10/src/pppoe-sniff.c --- rp-pppoe-3.10-orig/src/pppoe-sniff.c 2008-07-01 02:00:43.000000000 +1200 +++ rp-pppoe-3.10/src/pppoe-sniff.c 2011-09-05 07:23:10.000000000 +1200 @@ -200,8 +200,8 @@ #endif - /* We assume interface is in promiscuous mode -- use ifconfig to - ensure this */ + /* We assume interface is in promiscuous mode -- use 'ip link show' to + ensure this */ fprintf(stderr, "Sniffing for PADR. Start your connection on another machine...\n"); while (!SeenPADR) { if (receivePacket(sock, &pkt, &size) < 0) continue;