Todd T. Fries wrote:
If you use the kernel mode pppoe, you can ifconfig add them as an
alias to the interface, you might be able to do the same to the tun
interface, see if it works...

You are showing your roots, tun0:0 and tun0:1 are Linux naming
conventions, here in OpenBSD we just add addresses to the device
itself as 'aliases' aka:

  # ifconfig fxp0 inet 1.2.3.4 netmask 255.255.255.0
  # ifconfig fxp0 inet alias 1.2.3.5 netmask 255.255.255.0
  # ifconfig fxp0 inet alias 1.2.3.6 netmask 255.255.255.0
  # ifconfig fxp0
  fxp0: flags=...
  [..]
        inet 1.2.3.4 netmask 0xffffff00 broadcast 1.2.3.255
        inet 1.2.3.5 netmask 0xffffff00 broadcast 1.2.3.255
        inet 1.2.3.6 netmask 0xffffff00 broadcast 1.2.3.255

For further reading see ifconfig(8), hostname.if(5), and
pppoe(4) (as opposed to pppoe(8)).

Penned by Scott McEachern on 20090525 11:26.33, we have:
Hello all,

I currently have a single line DSL connection with my ISP and I am considering getting a 2nd IP from them for a second domain. The DSL modem (a speedtouch 516 which has a single ethernet connection to the LAN) is in bridge mode so the OpenBSD firewall handles the connection/authentication.

I was wondering if there is a way to have ppp/pppoe bind a second IP address to one DSL connection? And if this is possible, would the IPs then be bound to tun0:0 and tun0:1? I cannot find an answer to this in my research.

This is my current setup for a single IP, which works wonderfully:

In /etc/rc.local:

if [ -f /is_fw0 ]; then
   echo -n ' PPPoE ';
   ppp -ddial pppoe
   sleep 2
fi

In /etc/ppp/ppp.conf:

default:
set log Phase Chat IPCP CCP tun command
set redial 3 0
set reconnect 5 100000

pppoe:
set device "!/usr/sbin/pppoe -i ne3"
set mtu 1492
set mrru 1524
set speed sync
set cd 5
set dial
set login
set timeout 0
set authname myusername
set authkey mypassword
add! default HISADDR
enable dns
enable mssfixup



--

- RSM

http://www.erratic.ca

Thanks Todd, and sorry for getting back to you so late. I'll leave this here so others searching, like I did, can get an answer.

As it turns out, at least with my ISP (TekSavvy in Canada if that helps anyone) once you go past having a single IP assigned to you, that IP becomes a gateway for the new IPs in the ISPs eyes.

I was thinking there would be some type of PAD* interaction beyond getting the first IP, but there isn't, you "just use" the new IPs by exactly what you said above, aliasing them to your $ext_if.

So the specifics for OpenBSD is that this is completely do-able with userland pppoe. Keep the existing pppoe setup for the single IP as is, and just modify the /etc/ppp/ppp.linkup file as such: (Assuming you were given a.b.c.d/30)

MYADDR:
!bg sh -c "/sbin/ifconfig tun0 alias a.b.c.d netmask 255.255.255.255"
[...]
!bg sh -c "/sbin/ifconfig tun0 alias a.b.c.d+3 netmask 255.255.255.255"
!bg sh -c "/sbin/pfctl -ef /etc/pf.conf"
!bg sh -c "pkill -1 named"

The last two lines are to load a pppoe-aware pf.conf and to let the name server start listening on any external address per named.conf. The result is that adding a /30 actually gives a total of 5 usable IPs: the original IP, what you would think are the 'network' and 'broadcast' addresses for the /30, plus the two 'normal' usable addresses. After that, it was just a matter of myself and pf.conf having a chat, and all is well. :)

--

- RSM

http://www.erratic.ca

Reply via email to