Advertisement
BasicXP

OpenWrt: PPPoE+DHCP Dual Access

Aug 24th, 2012
1,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. WARNING! This is no longer needed on fresh builds of OpenWrt, which correctly handles DHCP+PPPoE using standard configuration means.
  2.  
  3. /etc/config/network
  4. -----------------------------
  5. config interface 'wan'
  6. option ifname 'eth1'
  7. option proto 'dhcp'
  8.  
  9. config interface 'wan2'
  10. option proto 'none'
  11. option ifname 'ppp0'
  12. option username 'LOGIN'
  13. option password 'PASSWORD'
  14.  
  15. /etc/config/firewall
  16. -----------------------------
  17. config zone
  18. option name 'wan'
  19. option input 'REJECT'
  20. option output 'ACCEPT'
  21. option forward 'REJECT'
  22. option masq '1'
  23. option mtu_fix '1'
  24. option network 'wan wan2'
  25.  
  26. /etc/hotplug.d/iface/30-pppoe
  27. -----------------------------
  28. #!/bin/sh
  29. [ "$INTERFACE" = wan ] && {
  30. [ "$ACTION" = ifup ] && /usr/sbin/pppd \
  31. plugin rp-pppoe.so \
  32. mtu 1492 \
  33. mru 1492 \
  34. eth1 persist \
  35. usepeerdns \
  36. defaultroute \
  37. replacedefaultroute \
  38. user $(uci get network.wan2.username) \
  39. password $(uci get network.wan2.password) \
  40. lcp-echo-interval 5 \
  41. lcp-echo-failure 3 \
  42. unit 0
  43. [ "$ACTION" = ifdown ] && kill `ps | grep rp-pppoe | grep plugin | awk '{print $1}'`
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement