https://github.com/Lenniusce/pppoe

DeviceInterfaceIP
PPPOE_Server – vIOS RouterG0/1
PPPOE_Client – vIOS SwitchG0/0
G0/1
G0/2
G0/3
VLAN101
VLAN102
VLAN103
Computer_1 – Ubuntu LinuxE010.1.1.2
Computer_2 – Ubuntu LinuxE010.2.1.2
Computer_3 – Ubuntu LinuxE010.3.1.2


SERVER ROUTER

bba-group pppoe global
virtual-template 1

Then

interface virtual-template 1
ip address 172.18.0.1 255.255.255.0
mtu 1492
ip tcp adjust-mss 1452
peer default ip address pool CLIENT
ppp authentication pap callin

Then

ip local pool CLIENT 172.18.0.2 172.18.0.10

Then

username LENNY password CISCO

Then

interface GigabitEthernet0/0
no shutdown
ip address dhcp
interface GigabitEthernet0/1
no shutdown
pppoe enable group global
ip route 0.0.0.0 0.0.0.0 G0/0

CLIENT ROUTER

Then

interface GigabitEthernet1
no ip address
negotiation auto
pppoe enable
pppoe-client dial-pool-number 103
pppoe-client dial-pool-number 102
pppoe-client dial-pool-number 101

Then

ip dhcp pool COMPUTER_1
network 10.1.1.0 255.255.255.0
default-router 10.1.1.1
ip dhcp pool COMPUTER_2
network 10.2.1.0 255.255.255.0
default-router 10.2.1.1
ip dhcp pool COMPUTER_3
network 10.3.1.0 255.255.255.0
default-router 10.3.1.1

Then

interface Gigabitethernet2
no shutdown
ip address 10.1.1.1 255.255.255.0
ip nat inside
ip policy route-map DIALER_101
interface Gigabitethernet3
no shutdown
ip address 10.2.1.1 255.255.255.0
ip nat inside
ip policy route-map DIALER_102
interface Gigabitethernet4
no shutdown
ip address 10.3.1.1 255.255.255.0
ip nat inside
ip policy route-map DIALER_103

Then

interface Dialer101
mtu 1492
ip address negotiated
no ip redirects
ip nat outside
encapsulation ppp
ip tcp adjust-mss 1442
dialer pool 101
no cdp enable
ppp authentication pap callin
ppp pap sent-username LENNY password 0 CISCO
ppp ipcp route default
interface Dialer102
mtu 1492
ip address negotiated
no ip redirects
ip nat outside
encapsulation ppp
ip tcp adjust-mss 1442
dialer pool 102
no cdp enable
ppp authentication pap callin
ppp pap sent-username LENNY password 0 CISCO
ppp ipcp route default
interface Dialer103
mtu 1492
ip address negotiated
no ip redirects
ip nat outside
encapsulation ppp
ip tcp adjust-mss 1442
dialer pool 103
no cdp enable
ppp authentication pap callin
ppp pap sent-username LENNY password 0 CISCO
ppp ipcp route default

Then

ip nat inside source route-map NAT_101 interface Dialer101 overload
ip nat inside source route-map NAT_102 interface Dialer102 overload
ip nat inside source route-map NAT_103 interface Dialer103 overload

Then

ip access-list extended COMPUTER1
10 permit ip 10.1.0.0 0.0.255.255 any
ip access-list extended COMPUTER2
10 permit ip 10.2.0.0 0.0.255.255 any
ip access-list extended COMPUTER3
10 permit ip 10.3.0.0 0.0.255.255 any

Then

route-map DIALER_101 permit 10
match ip address COMPUTER1
set interface Dialer101
route-map DIALER_102 permit 10
match ip address COMPUTER2
set interface Dialer102
route-map DIALER_103 permit 10
match ip address COMPUTER3
set interface Dialer103
route-map NAT_101 permit 10
match ip address COMPUTER1
set interface Dialer101
route-map NAT_102 permit 10
match ip address COMPUTER2
set interface Dialer102
route-map NAT_103 permit 10
match ip address COMPUTER3
set interface Dialer103
track 1 interface Dialer101 ip routing
track 2 interface Dialer102 ip routing
track 3 interface Dialer103 ip routing
ip route 0.0.0.0 0.0.0.0 Dialer101 track 1
ip route 0.0.0.0 0.0.0.0 Dialer102 track 2
ip route 0.0.0.0 0.0.0.0 Dialer103 track 3
event manager applet FlushNAT-D1
event track 1 state any
action 1.1 cli command "enable"
action 1.2 cli command "clear ip nat translation *"
!
event manager applet FlushNAT-D2
event track 2 state any
action 1.1 cli command "enable"
action 1.2 cli command "clear ip nat translation *"
!
event manager applet FlushNAT-D3
event track 3 state any
action 1.1 cli command "enable"
action 1.2 cli command "clear ip nat translation *"

COMPUTERS

Computer1 = 10.1.1.2
Computer2 = 10.2.1.2
Computer3 = 10.3.1.3

Leave a comment

Trending