Enable true bridge mode for AT&T U-Verse and pfSense (this is a fork of an original repository https://github.com/aus/pfatt. Since it is not available anymore, I'll do my best to maintain a copy for people that still need a bypass)
This repository includes my notes on enabling a true bridge mode setup with AT&T U-Verse and pfSense. This method utilizes netgraph which is a graph based kernel networking subsystem of FreeBSD. This low-level solution was required to account for the unique issues surrounding bridging 802.1X traffic and tagging a VLAN with an id of 0. I've tested and confirmed this setup works with AT&T U-Verse Internet on the ARRIS NVG589, NVG599 and BGW210-700 residential gateways (probably others too). For Pace 5268AC see special details below.
There are a few other methods to accomplish true bridge mode, so be sure to see what easiest for you. True Bridge Mode is also possible in a Linux via ebtables or using hardware with a VLAN swap trick. For me, I was not using a Linux-based router and the VLAN swap did not seem to work for me.
While many AT&T residential gateways offer something called IP Passthrough, it does not provide the same advantages of a true bridge mode. For example, the NAT table is still managed by the gateway, which is limited to a measly 8192 sessions (although it becomes unstable at even 60% capacity).
The netgraph method will allow you to fully utilize your own router and fully bypass your residential gateway. It survives reboots, re-authentications, IPv6, and new DHCP leases.
Before continuing to the setup, it's important to understand how this method works. This will make configuration and troubleshooting much easier.
First, let's talk about what happens in the standard setup (without any bypass). At a high level, the following process happens when the gateway boots up:
To bypass the gateway using pfSense, we can emulate the standard procedure. If we connect our Residential Gateway and ONT to our pfSense box, we can bridge the 802.1/X authentication sequence, tag our WAN traffic as VLAN0, and request a public IPv4 via DHCP using a spoofed MAC address.
Unfortunately, there are some challenges with emulating this process. First, it's against RFC to bridge 802.1/X traffic and it is not supported. Second, tagging traffic as VLAN0 is not supported through the standard interfaces.
This is where netgraph comes in. Netgraph allows you to break some rules and build the proper plumbing to make this work. So, our cabling looks like this:
Residential Gateway [ONT Port] | | [nic0] pfSense [nic1] | | [ONT] Outside
With netgraph, our procedure looks like this (at a high level):
ngeth0. This interface is connected to
ng_vlanwhich is configured to tag all traffic as VLAN0 before sending it on to the ONT interface.
ngeth0as the WAN interface.
ngeth0. The packets get tagged as VLAN0 and exit to the ONT.
Hopefully, that now gives you an idea of what we are trying to accomplish. See the comments and commands
bin/pfatt.shfor details about the netgraph setup.
But enough talk. Now for the fun part!
At this time there is a bug in pFsense 2.4.5 and ngetf module is only included in pFsense 2.4.5 _amd64 build. Should be fixed in 2.4.5-p1.
PFSense Builds for Netgate hardware may not include ngetf (Confimred on SG4860-Desktop 2.4.5-p1). Confirm ngetf exists before continuing and look at Before-pfSense-2.4.5 branch for gudiance if it doesn't exist.
If you are running pfSense on anything other than amd64 architecture you should compile your own version of ngetf. Look at Before-pfSense-2.4.5 branch for some guidance on compiling and running your own ngetf.
If you only have two NICs, you can buy this cheap USB 100Mbps NIC from Amazon as your third. It has the Asix AX88772 chipset, which is supported in FreeBSD with the axe driver. I've confirmed it works in my setup. The driver was already loaded and I didn't have to install or configure anything to get it working. Also, don't worry about the poor performance of USB or 100Mbps NICs. This third NIC will only send/recieve a few packets periodicaly to authenticate your Router Gateway. The rest of your traffic will utilize your other (and much faster) NICs.
Edit the following configuration variables in
bin/pfatt.shas noted below.
$RG_ETHER_ADDRshould match the MAC address of your Residential Gateway. AT&T will only grant a DHCP lease to the MAC they assigned your device. In my environment, it's:
shell ONT_IF='xx0' # NIC -> ONT / Outside RG_IF='xx1' # NIC -> Residential Gateway's ONT port RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx' # MAC address of Residential Gateway
/root/bin(or any directory):
ssh [email protected] mkdir /root/bin scp bin/pfatt.sh [email protected]:/root/bin/ ssh [email protected] chmod +x /root/bin/pfatt.sh
NOTE: If you have the 5268AC, you'll also need to install
pfatt-5268.sh. The scripts monitor your connection and disable or enable the EAP bridging as needed. It's a hacky workaround, but it enables you to keep your 5268AC connected, avoid EAP-Logoffs and survive reboots. Consider changing the
pfatt-5268AC.shto a reliable host. Then perform these additional steps to install:
scp bin/pfatt-5268AC-startup.sh [email protected]:/usr/local/etc/rc.d/pfatt-5268AC-startup.sh scp bin/pfatt-5268AC.sh [email protected]:/root/bin/ ssh [email protected] chmod +x /usr/local/etc/rc.d/pfatt-5268AC-startup.sh /root/bin/pfatt-5268AC.sh
To start pfatt.sh script at the beginning of the boot process pfSense team recomments you use a package called shellcmd. Use pfSense package installer to find and install it. Once you have shellcmd package installed you can find it in Services > Shellcmd. Now add a new command and fill it up accordingly (make sure to select earlyshellcmd from a dropdown):
Command: /root/bin/pfatt.sh Shellcmd Type: earlyshellcmdIt should look like this:
This can also be acomplished by manually editing your pfSense /conf/config.xml file. Add /root/bin/pfatt.sh above . This method is not recommended and is frowned upon by pfSense team.
$RG_IFto Residential Gateway on the ONT port (not the LAN ports!)
$ONT_IFto ONT (outside)
LAN NICto local switch (as normal)
Prepare for console access.
pfSense will detect new interfaces on bootup. Follow the prompts on the console to configure
ngeth0as your pfSense WAN. Your LAN interface should not normally change. However, if you moved or re-purposed your LAN interface for this setup, you'll need to re-apply any existing configuration (like your VLANs) to your new LAN interface. pfSense does not need to manage
$ONT_IF. I would advise not enabling those interfaces in pfSense as it can cause problems with the netgraph.
In the webConfigurator, configure the WAN interface (
ngeth0) to DHCP using the MAC address of your Residential Gateway.
If everything is setup correctly, netgraph should be bridging EAP traffic between the ONT and RG, tagging the WAN traffic with VLAN0, and your WAN interface configured with an IPv4 address via DHCP.
Once your netgraph setup is in place and working, there aren't any netgraph changes required to the setup to get IPv6 working. These instructions can also be followed with a different bypass method other than the netgraph method. Big thanks to @pyrodex1980's post on DSLReports for sharing your notes.
This setup assumes you have a fairly recent version of pfSense. I'm using 2.4.5.
If you have additional LAN interfaces repeat these steps for each interface except be sure to provide an IPv6 Prefix ID that is not 0 and is unique among the interfaces you've configured so far.
DHCPv6 Server & RA
If you have additional LAN interfaces repeat these steps for each interface.
That's it! Now your clients should be receiving public IPv6 addresses via DHCP6.
pfatt-5268AC.shcan be found in
Use tcpdump to watch the authentication, vlan and dhcp bypass process (see above). Run tcpdumps on the
$ONT_IFinterface and the
tcpdump -ei $ONT_IF tcpdump -ei $RG_IF
Restart your Residential Gateway. From the
$RG_IFinterface, you should see some EAPOL starts like this:
MAC (oui Unknown) > MAC (oui Unknown), ethertype EAPOL (0x888e), length 60: POL start
If you don't see these, make sure you're connected to the ONT port.
These packets come every so often. I think the RG does some backoff / delay if doesn't immediately auth correctly. You can always reboot your RG to initiate the authentication again.
If your netgraph is setup correctly, the EAP start packet from the
$RG_IFwill be bridged onto your
$ONT_IFinterface. Then you should see some more EAP packets from the
$RG_IFinterface as they negotiate 802.1/X EAP authentication.
Once that completes, watch
ngeth0for DHCP traffic.
tcpdump -ei $ONT_IF port 67 or port 68 tcpdump -ei ngeth0 port 67 or port 68
Verify you are seeing 802.1Q (tagged as vlan0) traffic on your
$ONT_IFinterface and untagged traffic on
Verify the DHCP request is firing using the MAC address of your Residential Gateway.
If the VLAN0 traffic is being properly handled, next pfSense will need to request an IP.
ngeth0needs to DHCP using the authorized MAC address. You should see an untagged DCHP request on
ngeth0carry over to the
$ONT_IFinterface tagged as VLAN0. Then you should get a DHCP response and you're in business.
If you don't see traffic being bridged between
$ONT_IF, then netgraph is not setup correctly.
$RG_IFin promiscuous mode via
/sbin/ifconfig $RG_IF promisc. Otherwise, the EAP packets would not bridge. I think this is necessary for everyone but I'm not sure. Turn it off if it's causing issues.
The netgraph system provides a uniform and modular system for the implementation of kernel objects which perform various networking functions. If you're unfamiliar with netgraph, this tutorial is a great introduction.
Your netgraph should look something like this:
In this setup, the
ue0interface is my
bce0interface is my
$ONT_IF. You can generate your own graphviz via
ngctl dot. Copy the output and paste it at webgraphviz.com.
Try these commands to inspect whether netgraph is configured properly.
Confirm kernel modules are loaded with
kldstat -v. The following modules are required:
ngctl listto list netgraph nodes. Inspect
pfatt.shto verify the netgraph output matches the configuration in the script. It should look similar to this:
$ ngctl list There are 9 total nodes: Name: o2m Type: one2many ID: 000000a0 Num hooks: 3 Name: vlan0 Type: vlan ID: 000000a3 Num hooks: 2 Name: ngeth0 Type: eiface ID: 000000a6 Num hooks: 1 Name: Type: socket ID: 00000006 Num hooks: 0 Name: ngctl28740 Type: socket ID: 000000ca Num hooks: 0 Name: waneapfilter Type: etf ID: 000000aa Num hooks: 2 Name: laneapfilter Type: etf ID: 000000ae Num hooks: 3 Name: bce0 Type: ether ID: 0000006e Num hooks: 1 Name: ue0 Type: ether ID: 00000016 Num hooks: 2
Inspect the various nodes and hooks. Example for
ue0: ``` $ ngctl show ue0: Name: ue0 Type: ether ID: 00000016 Num hooks: 2 Local hook Peer name Peer type Peer ID Peer hook
upper laneapfilter etf 000000ae nomatch lower laneapfilter etf 000000ae downstream ```
pfatt.shexpects a clean netgraph before it can be ran. To reset a broken netgraph state, try this:
/usr/sbin/ngctl shutdown waneapfilter: /usr/sbin/ngctl shutdown laneapfilter: /usr/sbin/ngctl shutdown $ONT_IF: /usr/sbin/ngctl shutdown $RG_IF: /usr/sbin/ngctl shutdown o2m: /usr/sbin/ngctl shutdown vlan0: /usr/sbin/ngctl shutdown ngeth0:
In some circumstances, pfSense may alter your netgraph. This is especially true if pfSense manages either your
$ONT_IF. If you make some interface changes and your connection breaks, check to see if your netgraph was changed.
This setup has been tested on physical servers and virtual machines. Virtualization adds another layer of complexity for this setup, and will take extra consideration.
Proxmox uses a bridged networking model, and thus utilizes Linux's native bridge capability. To use this netgraph method, you do a PCI passthrough for the
$ONT_IFNICs. The bypass procedure should then be the same.
You can also solve the EAP/802.1X and VLAN0/802.1Q problem by setting the
group_fwd_maskand creating a vlan0 interface to bridge to your VM. See Other Methods below.
I haven't tried to do this with ESXi. Feel free to submit a PR with notes on your experience. PCI passthrough is probably the best approach here though.
If you're looking how to do this on a Linux-based router, please refer to this method which utilizes ebtables and some kernel features. The method is well-documented there and I won't try to duplicate it. This method is generally more straight forward than doing this on BSD. However, please submit a PR for any additional notes for running on Linux routers.
There is a whole thread on this at DSLreports. The gist of this method is that you connect your ONT, RG and WAN to a switch. Create two VLANs. Assign the ONT and RG to VLAN1 and the WAN to VLAN2. Let the RG authenticate, then change the ONT VLAN to VLAN2. The WAN the DHCPs and your in business.
However, I don't think this works for everyone. I had to explicitly tag my WAN traffic to VLAN0 which wasn't supported on my switch.
For OPNSense 20.1: follow the pfSense instructions, EXCEPT: 1) use file opnatt.sh 2) do NOT install the ng_etf.ko, as OPNSense already has this module installed. 3) put the opnatt.sh script into
99-opnatt.sh4) do NOT modify config.xml, nor do any of the duid stuff 5) note: You CAN use IPv6 Prefix id 0, as OPNSense does NOT assign a routeable IPv6 address to ngeth0
I haven't tried this with native FreeBSD, but I imagine the process is ultimately the same with netgraph. Feel free to submit a PR with notes on your experience.
This took a lot of testing and a lot of hours to figure out. A unique solution was required for this to work in pfSense. If this helped you out, please buy us a coffee.