[FUG-BR] Dois IPs com PPPoE no Mesmo Servidor

Marcelo/Porks marcelorossi em gmail.com
Terça Abril 29 12:06:21 BRT 2008


Pessoal, tenho um cenário peculiar/bizarro aqui.

Se ficar ruim de visualizar este e-mail (por causa da quebra de linha)
vocês podem ver usando o endereço:
http://www.mii.com.br/dois_ip_pppoe.txt

Primeiramente: meu provedor trabalha com PPPoE.

Eu precisava de dois IPS, então conversei com meu provedor e eles me
forneceram dois IPS, e disseram para eu fazer a seguinte configuração:

<ISP> ---- <RADIO> --- <UM_UNICO_CABO_DE_REDE> --- <SWITCH> ---
<CABO_DE_REDE> --- <MEU_FIREWALL_BSD>
......................................................................................................................|___<OUTRO_COMPUTADOR>

Deste modo funciona tudo que preciso,
- o <MEU_FIREWALL_BSD> utiliza o usuário marcelo1 at porks.com.br e obtem
o ip 189.75.73.60
- o <OUTRO_COMPUTADOR> utiliza o usuário marcelo2 at porks.com.br e obtem
o ip 189.75.73.30
- conseguem navegar na internet, tudo normal.

Entretanto eu queria que os dois ips ficassem no firewall, e este
redirecionasse para o <OUTRO_COMPUTADOR>.

Fazer o redirecionamento eu consigo sem problema algum (já fiz isso
quando eu tinha dois ips fornecidos, não por PPPoE e sim, fixados na
NIC)

O meu problema é justamente o PPPoE eu tentei dois cenários de
configuração e nos dois acontece o mesmo problema:
- consigo fazer a discagem da primeira conexão PPPoE com sucesso, tudo
funciona com ela.
- Quando vou fazer a segunda discagem aparece a seguinte mensagem no
/var/log/ppp.log

Apr 26 10:42:35 mt ppp[1519]: tun2: Warning: iface add:
ioctl(SIOCAIFADDR, 189.75.73.30 -> 189.75.73.1): File exists
Apr 26 10:42:35 mt ppp[1519]: tun2: Error: ipcp_InterfaceUp: unable to
set ip address

(o log completo está no final deste e-mail, meu ppp.conf também está
no fim do email...)
(a conexão marcelo1 at porks.com.br aparece como tun1 e
marcelo2 at porks.com.br como tun2, pois eu já tenho a tun0 que é uma
vpn, mas este não é o problema, pois testei também sem esta vpn e não
funciona do mesmo jeito)...

===============================
os dois cenários que tentei foram os seguintes:
-------------cenário 1-----------------
<ISP> ---- <RADIO> --- <UM_UNICO_CABO_DE_REDE> --- <SWITCH> ---
<CABO_DE_REDE> --- <NIC1_MEU_FIREWALL_BSD>
......................................................................................................................|_______________<NIC2_MEU_FIREWALL_BSD>

- Ou seja, liguei no switch e do switch peguei dois cabos para duas
placas diferentes do MESMO computador

- /etc/ppp/ppp.conf:
default:
 set log Phase tun command

marcelo1:
 set device PPPoE:vr3
 set authname marcelo1 at porks.com.br
 set authkey 123mudar
 set dial
 set login
 add default HISADDR
 enable dns
 nat enable yes

marcelo2:
 set device PPPoE:vr0
 set authname marcelo2 at porks.com.br
 set authkey 321mudar
 set dial
 set login
# add default HISADDR
# enable dns
# nat enable yes

-------------cenário 2-----------------
<ISP> ---- <RADIO> --- <UM_UNICO_CABO_DE_REDE> --- <NIC1_MEU_FIREWALL_BSD>

- Ou seja, liguei o rádio diretamente em uma placa do computador

- /etc/ppp/ppp.conf:
default:
 set log Phase tun command

marcelo1:
 set device PPPoE:vr0
 set authname marcelo1 at porks.com.br
 set authkey 123mudar
 set dial
 set login
 add default HISADDR
 enable dns
 nat enable yes

marcelo2:
 set device PPPoE:vr0
 set authname marcelo2 at porks.com.br
 set authkey 321mudar
 set dial
 set login
# add default HISADDR
# enable dns
# nat enable yes
===============================
Nos dois casos o /var/log/ppp.log apresenta essas mensagens:

Apr 26 10:40:39 mt ppp[1455]: Phase: Using interface: tun1
Apr 26 10:40:39 mt ppp[1455]: Phase: deflink: Created in closed state
Apr 26 10:40:39 mt ppp[1455]: tun1: Command: marcelo1: set device PPPoE:vr3
Apr 26 10:40:39 mt ppp[1455]: tun1: Command: marcelo1: set authname
marcelo1 at porks.com.br
Apr 26 10:40:39 mt ppp[1455]: tun1: Command: marcelo1: set authkey ********
Apr 26 10:40:39 mt ppp[1455]: tun1: Command: marcelo1: set dial
Apr 26 10:40:39 mt ppp[1455]: tun1: Command: marcelo1: set login
Apr 26 10:40:39 mt ppp[1456]: tun1: Phase: PPP Started (ddial mode).
Apr 26 10:40:39 mt ppp[1456]: tun1: Phase: bundle: Establish
Apr 26 10:40:39 mt ppp[1456]: tun1: Phase: deflink: closed -> opening
Apr 26 10:40:40 mt ppp[1456]: tun1: Phase: deflink: Connected!
Apr 26 10:40:40 mt ppp[1456]: tun1: Phase: deflink: opening -> dial
Apr 26 10:40:40 mt ppp[1456]: tun1: Phase: deflink: dial -> carrier
Apr 26 10:40:40 mt ppp[1456]: tun1: Phase: Received NGM_PPPOE_ACNAME
(hook "router1-blabla.porks.com.br")
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: Received NGM_PPPOE_SESSIONID
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: Received NGM_PPPOE_SUCCESS
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: deflink: carrier -> login
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: deflink: login -> lcp
Apr 26 10:40:41 mt ppp[1456]: tun1: Warning: deflink: Reducing
configured MRU from 1500 to 1492
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: bundle: Authenticate
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: deflink: his = CHAP 0x81, mine = none
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: Chap Input: CHALLENGE (16
bytes from router1-blabla.porks.com.br)
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: Chap Output: RESPONSE
(marcelo1 at porks.com.br)
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: Chap Input: SUCCESS
(S=6F823CABBB269270370794F63B3C7F9603B7EAD5)
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: deflink: lcp -> open
Apr 26 10:40:41 mt ppp[1456]: tun1: Phase: bundle: Network
Apr 26 10:41:08 mt ppp[1518]: Phase: Using interface: tun2
Apr 26 10:41:08 mt ppp[1518]: Phase: deflink: Created in closed state
Apr 26 10:41:08 mt ppp[1518]: tun2: Command: marcelo2: set device PPPoE:vr0
Apr 26 10:41:08 mt ppp[1518]: tun2: Command: marcelo2: set authname
marcelo2 at porks.com.br
Apr 26 10:41:08 mt ppp[1518]: tun2: Command: marcelo2: set authkey ********
Apr 26 10:41:08 mt ppp[1518]: tun2: Command: marcelo2: set dial
Apr 26 10:41:08 mt ppp[1518]: tun2: Command: marcelo2: set login
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: PPP Started (ddial mode).
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: bundle: Establish
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: deflink: closed -> opening
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: deflink: Connected!
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: deflink: opening -> dial
Apr 26 10:41:08 mt ppp[1519]: tun2: Phase: deflink: dial -> carrier
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Received NGM_PPPOE_ACNAME
(hook "router1-blabla.porks.com.br")
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Received NGM_PPPOE_SESSIONID
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Received NGM_PPPOE_SUCCESS
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: carrier -> login
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: login -> lcp
Apr 26 10:41:09 mt ppp[1519]: tun2: Warning: deflink: Reducing
configured MRU from 1500 to 1492
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: bundle: Authenticate
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: his = CHAP 0x81, mine = none
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Chap Input: CHALLENGE (16
bytes from router1-blabla.porks.com.br)
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Chap Output: RESPONSE
(marcelo2 at porks.com.br)
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: Chap Input: SUCCESS
(S=ADC3FBE6D7727BDBCC95635D99A807F9930FDC9F)
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: lcp -> open
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: bundle: Network
Apr 26 10:41:09 mt ppp[1519]: tun2: Warning: iface add:
ioctl(SIOCAIFADDR, 189.75.73.30 -> 189.75.73.1): File exists
Apr 26 10:41:09 mt ppp[1519]: tun2: Error: ipcp_InterfaceUp: unable to
set ip address
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: bundle: Terminate
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: open -> lcp
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: Disconnected!
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: lcp -> logout
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: logout -> hangup
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: Disconnected!
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: Connect time: 1
secs: 276 octets in, 241 octets out
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: 15 packets in, 14
packets out
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase:  total 517 bytes/sec, peak
0 bytes/sec on Sat Apr 26 10:41:08 2008
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: hangup -> opening
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: bundle: Establish
Apr 26 10:41:09 mt ppp[1519]: tun2: Phase: deflink: Enter pause (3)
for redialing.

Obrigado a todos pela paciência.

-- 
Marcelo Rossi
"This e-mail is provided "AS IS" with no warranties, and confers no rights."


Mais detalhes sobre a lista de discussão freebsd