Compare commits
12 commits
master
...
supplicant
Author | SHA1 | Date | |
---|---|---|---|
274bdf95b6 | |||
![]() |
025dd396e9 | ||
![]() |
92b638d842 | ||
![]() |
1429436f75 | ||
![]() |
994f36a727 | ||
![]() |
faa80d09f9 | ||
![]() |
4fe449c390 | ||
![]() |
c4109acdc6 | ||
![]() |
33bec4c32b | ||
![]() |
d07a0873ea | ||
![]() |
fa68a1ab5b | ||
![]() |
304f841d88 |
24 changed files with 359 additions and 1242 deletions
|
@ -1,14 +0,0 @@
|
|||
#!/bin/csh
|
||||
#Script to grab all relevant configuration files and installed packages, and back it up to github
|
||||
/usr/sbin/pkg prime-origins > /root/fw/pkg_prime-origins
|
||||
|
||||
foreach i ( "/boot/loader.conf" "/etc/pf.conf" "/etc/rc.conf" "/etc/start_if.eth0" "/usr/local/etc/dhcpd.conf" "/usr/local/etc/namedb/named.conf" "/usr/local/etc/namedb/dynamic/example.com.db" "/var/cron/tabs/root" "/usr/local/etc/dhcp6c.conf" "/etc/rtadvd.conf" "/usr/local/etc/dhcpd6.conf" "/etc/dhclient.conf" )
|
||||
echo "Backing up "$i
|
||||
/bin/cp $i /root/fw$i
|
||||
end
|
||||
|
||||
echo "git push"
|
||||
cd /root/fw/
|
||||
/usr/local/bin/git add .
|
||||
/usr/local/bin/git commit -S -m "nightly backup"
|
||||
/usr/local/bin/git push -u origin main
|
|
@ -1,6 +0,0 @@
|
|||
netgraph_load="YES"
|
||||
ng_ether_load="YES"
|
||||
ng_etf_load="YES"
|
||||
ng_vlan_load="YES"
|
||||
ng_eiface_load="YES"
|
||||
ng_one2many_load="YES"
|
|
@ -1,10 +0,0 @@
|
|||
# $FreeBSD$
|
||||
#
|
||||
# This file is required by the ISC DHCP client.
|
||||
# See ``man 5 dhclient.conf'' for details.
|
||||
#
|
||||
# In most cases an empty file is sufficient for most people as the
|
||||
# defaults are usually fine.
|
||||
#
|
||||
#
|
||||
supersede domain-name-servers 127.0.0.1;
|
|
@ -1,60 +0,0 @@
|
|||
wan = "ngeth0"
|
||||
lan = "xxx"
|
||||
|
||||
#options
|
||||
set skip on lo0
|
||||
set block-policy drop
|
||||
set fingerprints "/etc/pf.os"
|
||||
set ruleset-optimization basic
|
||||
set optimization normal
|
||||
set limit { states 1624000, src-nodes 1624000, frags 5000, table-entries 400000 }
|
||||
|
||||
|
||||
#scrub
|
||||
scrub on $wan all random-id fragment reassemble
|
||||
scrub on $lan all random-id fragment reassemble
|
||||
|
||||
|
||||
#NAT
|
||||
nat on $wan inet from ($lan:network) to any -> ($wan)
|
||||
|
||||
|
||||
#Filter
|
||||
|
||||
#default deny
|
||||
block drop in inet all label "Default deny rule IPv4"
|
||||
block drop out inet all label "Default deny rule IPv4"
|
||||
block drop in inet6 all label "Default deny rule IPv6"
|
||||
block drop out inet6 all label "Default deny rule IPv6"
|
||||
|
||||
#allow dhcp/dhcpv6 client
|
||||
pass in quick on $wan proto udp from any port = bootps to any port = bootpc keep state label "allow dhcp client out WAN"
|
||||
pass out quick on $wan proto udp from any port = bootpc to any port = bootps keep state label "allow dhcp client out WAN"
|
||||
pass in quick on $wan inet6 proto udp from fe80::/10 port = dhcpv6-client to fe80::/10 port = dhcpv6-client keep state label "allow dhcpv6 client in WAN"
|
||||
pass in quick on $wan proto udp from any port = dhcpv6-server to any port = dhcpv6-client keep state label "allow dhcpv6 client in WAN"
|
||||
pass out quick on $wan proto udp from any port = dhcpv6-client to any port = dhcpv6-server keep state label "allow dhcpv6 client out WAN"
|
||||
|
||||
#allow dhcp/dhcpv6 server
|
||||
pass in quick on $lan inet proto udp from any port = bootpc to { 255.255.255.255, ($lan), ($lan:broadcast) } port = bootps keep state label "allow access to DHCP server"
|
||||
pass out quick on $lan inet proto udp from ($lan) port = bootps to any port = bootpc keep state label "allow access to DHCP server"
|
||||
pass quick on $lan inet6 proto udp from fe80::/10 to fe80::/10 port = dhcpv6-client keep state label "allow access to DHCPv6 server"
|
||||
pass quick on $lan inet6 proto udp from fe80::/10 to ff02::/16 port = dhcpv6-client keep state label "allow access to DHCPv6 server"
|
||||
pass quick on $lan inet6 proto udp from fe80::/10 to ff02::/16 port = dhcpv6-server keep state label "allow access to DHCPv6 server"
|
||||
pass quick on $lan inet6 proto udp from ff02::/16 to fe80::/10 port = dhcpv6-server keep state label "allow access to DHCPv6 server"
|
||||
pass in quick on $lan inet6 proto udp from fe80::/10 to ($lan) port = dhcpv6-client keep state label "allow access to DHCPv6 server"
|
||||
pass out quick on $lan inet6 proto udp from ($lan) port = dhcpv6-server to fe80::/10 keep state label "allow access to DHCPv6 server"
|
||||
|
||||
#icmpv6
|
||||
pass quick inet6 proto ipv6-icmp all icmp6-type { unreach, toobig, neighbrsol, neighbradv } keep state
|
||||
pass out quick inet6 proto ipv6-icmp from fe80::/10 to { fe80::/10, ff02::/16 } icmp6-type { echorep, routersol, routeradv, neighbrsol, neighbradv } keep state
|
||||
pass in quick inet6 proto ipv6-icmp from fe80::/10 to { fe80::/10, ff02::/16 } icmp6-type { echorep, routersol, routeradv, neighbrsol, neighbradv } keep state
|
||||
pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type { echorep, routersol, routeradv, neighbrsol, neighbradv } keep state
|
||||
pass in quick inet6 proto ipv6-icmp from :: to ff02::/16 icmp6-type { echorep, routersol, routeradv, neighbrsol, neighbradv } keep state
|
||||
|
||||
#allow self
|
||||
pass out inet all flags S/SA keep state allow-opts label "let out anything IPv4 from firewall host itself"
|
||||
pass out inet6 all flags S/SA keep state allow-opts label "let out anything IPv6 from firewall host itself"
|
||||
|
||||
#allow LAN
|
||||
pass in on $lan inet all flags S/SA keep state label "Default allow LAN to any rule"
|
||||
pass in on $lan inet6 all flags S/SA keep state label "Default allow LAN to any rule"
|
|
@ -1,44 +0,0 @@
|
|||
hostname="fw"
|
||||
ifconfig_eth0=""
|
||||
ifconfig_ngeth0="DHCP"
|
||||
ifconfig_ngeth0_ipv6="inet6 accept_rtadv up"
|
||||
ipv6_cpe_wanif="ngeth0"
|
||||
ifconfig_eth2="inet 192.168.1.1 netmask 255.255.255.0"
|
||||
ifconfig_eth2_ipv6="inet6 -accept-rtadv up"
|
||||
gateway_enable="YES"
|
||||
ipv6_gateway_enable="YES"
|
||||
ipv6_activate_all_interfaces="YES"
|
||||
rtadvd_enable="YES"
|
||||
rtadvd_interfaces="eth2"
|
||||
dhcp6c_enable="YES"
|
||||
dhcp6c_interfaces="ngeth0"
|
||||
dhcpd_enable="YES"
|
||||
dhcpd_flags="-q"
|
||||
dhcpd_conf="/usr/local/etc/dhcpd.conf"
|
||||
dhcpd_ifaces="eth2"
|
||||
dhcpd_withumask="022"
|
||||
dhcpd_chuser_enable="YES"
|
||||
dhcpd_withuser="dhcpd"
|
||||
dhcpd_withgroup="dhcpd"
|
||||
dhcpd_chroot_enable="YES"
|
||||
dhcpd_devfs_enable="YES"
|
||||
dhcpd_rootdir="/var/db/dhcpd"
|
||||
dhcpd6_enable="YES"
|
||||
dhcpd6_flags="-q"
|
||||
dhcpd6_conf="/usr/local/etc/dhcpd6.conf"
|
||||
dhcpd6_ifaces="eth2"
|
||||
dhcpd6_withumask="022"
|
||||
dhcpd6_chuser_enable="YES"
|
||||
dhcpd6_withuser="dhcpd"
|
||||
dhcpd6_withgroup="dhcpd"
|
||||
dhcpd6_chroot_enable="YES"
|
||||
dhcpd6_devfs_enable="YES"
|
||||
dhcpd6_rootdir="/var/db/dhcpd"
|
||||
pf_enable="YES"
|
||||
pf_rules="/etc/pf.conf"
|
||||
pflog_enable="YES"
|
||||
pflog_logfile="/var/log/pflog"
|
||||
powerd_enable="YES"
|
||||
powerd_flags="-b hadp -n hadp -a hadp"
|
||||
ntpd_enable="YES"
|
||||
sshd_enable="YES"
|
|
@ -1,2 +0,0 @@
|
|||
default:\
|
||||
:raflags="m"::prefixlen#64:\
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ONT_IF='eth0'
|
||||
RG_IF='eth1'
|
||||
RG_ETHER_ADDR='00:11:22:33:44'
|
||||
LOG=/var/log/freeatt.log
|
||||
|
||||
getTimestamp(){
|
||||
echo `date "+%Y-%m-%d %H:%M:%S :: [freeatt.sh] ::"`
|
||||
}
|
||||
|
||||
{
|
||||
echo "$(getTimestamp) FreeBSD pf + AT&T U-verse Residential Gateway for true bridge mode"
|
||||
echo "$(getTimestamp) Configuration: "
|
||||
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
||||
echo "$(getTimestamp) RG_IF: $RG_IF"
|
||||
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
||||
|
||||
echo "$(getTimestamp) building netgraph nodes..."
|
||||
|
||||
echo -n "$(getTimestamp) creating ng_one2many... "
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: one2many lower one
|
||||
/usr/sbin/ngctl name $ONT_IF:lower o2m
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) creating vlan node and interface... "
|
||||
/usr/sbin/ngctl mkpeer o2m: vlan many0 downstream
|
||||
/usr/sbin/ngctl name o2m:many0 vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $ONT_IF (ONT)... "
|
||||
/usr/sbin/ngctl mkpeer o2m: etf many1 downstream
|
||||
/usr/sbin/ngctl name o2m:many1 waneapfilter
|
||||
/usr/sbin/ngctl connect waneapfilter: $ONT_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $RG_IF (RG)... "
|
||||
/usr/sbin/ngctl mkpeer $RG_IF: etf lower downstream
|
||||
/usr/sbin/ngctl name $RG_IF:lower laneapfilter
|
||||
/usr/sbin/ngctl connect laneapfilter: $RG_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) bridging etf for $ONT_IF <-> $RG_IF... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining filters for EAP traffic... "
|
||||
/usr/sbin/ngctl msg waneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
/usr/sbin/ngctl msg laneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling one2many links... "
|
||||
/usr/sbin/ngctl msg o2m: setconfig "{ xmitAlg=2 failAlg=1 enabledLinks=[ 1 1 ] }"
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) removing waneapfilter:nomatch hook... "
|
||||
/usr/sbin/ngctl rmhook waneapfilter: nomatch
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $RG_IF interface... "
|
||||
/sbin/ifconfig $RG_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $ONT_IF interface... "
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $RG_IF... "
|
||||
/sbin/ifconfig $RG_IF promisc
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $ONT_IF... "
|
||||
/sbin/ifconfig $ONT_IF promisc
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) set mac address on ngeth0..."
|
||||
/sbin/ifconfig ngeth0 ether $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
|
||||
echo "$(getTimestamp) ngeth0 should now be available to configure as your pf WAN"
|
||||
echo "$(getTimestamp) done!"
|
||||
} >> $LOG
|
|
@ -1,6 +0,0 @@
|
|||
dns/bind916
|
||||
net/dhcp6
|
||||
devel/git
|
||||
security/gnupg
|
||||
net/isc-dhcp44-server
|
||||
ports-mgmt/pkg
|
|
@ -1,12 +0,0 @@
|
|||
interface ngeth0 {
|
||||
send ia-pd 0; # request prefix delegation
|
||||
request domain-name-servers;
|
||||
request domain-name;
|
||||
};
|
||||
id-assoc pd 0 {
|
||||
prefix ::/60 infinity;
|
||||
prefix-interface igb1 {
|
||||
sla-id 1;
|
||||
sla-len 4;
|
||||
};
|
||||
};
|
|
@ -1,44 +0,0 @@
|
|||
option domain-name "example.com";
|
||||
option ldap-server code 95 = text;
|
||||
option domain-search-list code 119 = text;
|
||||
option arch code 93 = unsigned integer 16; # RFC4578
|
||||
|
||||
default-lease-time 7200;
|
||||
max-lease-time 86400;
|
||||
log-facility local7;
|
||||
one-lease-per-client true;
|
||||
deny duplicates;
|
||||
update-conflict-detection false;
|
||||
authoritative;
|
||||
subnet 192.168.1.0 netmask 255.255.255.0 {
|
||||
pool {
|
||||
range 192.168.1.100 192.168.1.199;
|
||||
}
|
||||
|
||||
option routers 192.168.1.1;
|
||||
option domain-name-servers 192.168.1.1;
|
||||
ping-check true;
|
||||
|
||||
}
|
||||
host s_lan_0 {
|
||||
hardware ethernet 00:11:22:33:44:55;
|
||||
fixed-address 192.168.1.50
|
||||
option host-name "example-host1";
|
||||
}
|
||||
host s_lan_1 {
|
||||
hardware ethernet 66:77:88:99:aa:bb;
|
||||
fixed-address 192.168.1.51;
|
||||
option host-name "example-host2";
|
||||
}
|
||||
|
||||
ddns-update-style interim;
|
||||
ddns-dual-stack-mixed-mode true;
|
||||
update-conflict-detection true;
|
||||
update-optimization false;
|
||||
deny client-updates;
|
||||
ddns-domainname "example.com.";
|
||||
ddns-hostname=pick(option fqdn.hostname, option host-name, concat("dyn-",binary-to-ascii(10,8,"-",leased-address)));
|
||||
|
||||
zone example.com. {
|
||||
primary 127.0.0.1;
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
option domain-name "example.com";
|
||||
option ldap-server code 95 = text;
|
||||
option domain-search-list code 119 = text;
|
||||
|
||||
default-lease-time 7200;
|
||||
max-lease-time 86400;
|
||||
log-facility local7;
|
||||
one-lease-per-client true;
|
||||
deny duplicates;
|
||||
ping-check true;
|
||||
authoritative;
|
||||
subnet6 2600:1234:5678:90ab::/64 {
|
||||
range6 2600:1234:5678:90ab::1000 2600:1234:5678:90ab::2000;
|
||||
do-forward-updates false;
|
||||
option dhcp6.name-servers 2600:1234:5678:90ab::1;
|
||||
|
||||
}
|
||||
|
||||
ddns-update-style interim;
|
||||
ddns-dual-stack-mixed-mode true;
|
||||
update-conflict-detection true;
|
||||
update-optimization false;
|
||||
deny client-updates;
|
||||
ddns-domainname "example.com.";
|
||||
ddns-hostname=pick(option fqdn.hostname, concat("dyn-",binary-to-ascii(16,16,"-",substring(option dhcp6.ia-na, 16, 16))));
|
||||
|
||||
zone example.com. {
|
||||
primary 127.0.0.1;
|
||||
}
|
||||
|
||||
|
|
@ -1,385 +0,0 @@
|
|||
// Refer to the named.conf(5) and named(8) man pages, and the documentation
|
||||
// in /usr/local/share/doc/bind for more details.
|
||||
//
|
||||
// If you are going to set up an authoritative server, make sure you
|
||||
// understand the hairy details of how DNS works. Even with
|
||||
// simple mistakes, you can break connectivity for affected parties,
|
||||
// or cause huge amounts of useless Internet traffic.
|
||||
|
||||
options {
|
||||
allow-query { any; };
|
||||
recursion yes;
|
||||
query-source-v6 address 2600:1234:5678:90ab::1;
|
||||
// All file and path names are relative to the chroot directory,
|
||||
// if any, and should be fully qualified.
|
||||
directory "/usr/local/etc/namedb/working";
|
||||
pid-file "/var/run/named/pid";
|
||||
dump-file "/var/dump/named_dump.db";
|
||||
statistics-file "/var/stats/named.stats";
|
||||
|
||||
// If named is being used only as a local resolver, this is a safe default.
|
||||
// For named to be accessible to the network, comment this option, specify
|
||||
// the proper IP address, or delete this option.
|
||||
#listen-on { 127.0.0.1; };
|
||||
|
||||
// If you have IPv6 enabled on this system, uncomment this option for
|
||||
// use as a local resolver. To give access to the network, specify
|
||||
// an IPv6 address, or the keyword "any".
|
||||
// listen-on-v6 { ::1; };
|
||||
|
||||
listen-on-v6 { any; };
|
||||
|
||||
// These zones are already covered by the empty zones listed below.
|
||||
// If you remove the related empty zones below, comment these lines out.
|
||||
disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
|
||||
disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
|
||||
disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
|
||||
|
||||
// If you've got a DNS server around at your upstream provider, enter
|
||||
// its IP address here, and enable the line below. This will make you
|
||||
// benefit from its cache, thus reduce overall DNS traffic in the Internet.
|
||||
/*
|
||||
forwarders {
|
||||
127.0.0.1;
|
||||
};
|
||||
*/
|
||||
|
||||
// If the 'forwarders' clause is not empty the default is to 'forward first'
|
||||
// which will fall back to sending a query from your local server if the name
|
||||
// servers in 'forwarders' do not have the answer. Alternatively you can
|
||||
// force your name server to never initiate queries of its own by enabling the
|
||||
// following line:
|
||||
// forward only;
|
||||
|
||||
// If you wish to have forwarding configured automatically based on
|
||||
// the entries in /etc/resolv.conf, uncomment the following line and
|
||||
// set named_auto_forward=yes in /etc/rc.conf. You can also enable
|
||||
// named_auto_forward_only (the effect of which is described above).
|
||||
// include "/usr/local/etc/namedb/auto_forward.conf";
|
||||
|
||||
/*
|
||||
Modern versions of BIND use a random UDP port for each outgoing
|
||||
query by default in order to dramatically reduce the possibility
|
||||
of cache poisoning. All users are strongly encouraged to utilize
|
||||
this feature, and to configure their firewalls to accommodate it.
|
||||
|
||||
AS A LAST RESORT in order to get around a restrictive firewall
|
||||
policy you can try enabling the option below. Use of this option
|
||||
will significantly reduce your ability to withstand cache poisoning
|
||||
attacks, and should be avoided if at all possible.
|
||||
|
||||
Replace NNNNN in the example with a number between 49160 and 65530.
|
||||
*/
|
||||
// query-source address * port NNNNN;
|
||||
};
|
||||
|
||||
zone "thundat00th.net." { type master; allow-update { 127.0.0.1; }; file "/usr/local/etc/namedb/dynamic/example.com.db"; };
|
||||
|
||||
// If you enable a local name server, don't forget to enter 127.0.0.1
|
||||
// first in your /etc/resolv.conf so this server will be queried.
|
||||
// Also, make sure to enable it in /etc/rc.conf.
|
||||
|
||||
// The traditional root hints mechanism. Use this, OR the slave zones below.
|
||||
zone "." { type hint; file "/usr/local/etc/namedb/named.root"; };
|
||||
|
||||
/* Slaving the following zones from the root name servers has some
|
||||
significant advantages:
|
||||
1. Faster local resolution for your users
|
||||
2. No spurious traffic will be sent from your network to the roots
|
||||
3. Greater resilience to any potential root server failure/DDoS
|
||||
|
||||
On the other hand, this method requires more monitoring than the
|
||||
hints file to be sure that an unexpected failure mode has not
|
||||
incapacitated your server. Name servers that are serving a lot
|
||||
of clients will benefit more from this approach than individual
|
||||
hosts. Use with caution.
|
||||
|
||||
To use this mechanism, uncomment the entries below, and comment
|
||||
the hint zone above.
|
||||
|
||||
As documented at http://dns.icann.org/services/axfr/ these zones:
|
||||
"." (the root), ARPA, IN-ADDR.ARPA, IP6.ARPA, and a few others
|
||||
are available for AXFR from these servers on IPv4 and IPv6:
|
||||
xfr.lax.dns.icann.org, xfr.cjr.dns.icann.org
|
||||
*/
|
||||
/*
|
||||
zone "." {
|
||||
type slave;
|
||||
file "/usr/local/etc/namedb/slave/root.slave";
|
||||
masters {
|
||||
192.0.32.132; // lax.xfr.dns.icann.org
|
||||
2620:0:2d0:202::132; // lax.xfr.dns.icann.org
|
||||
192.0.47.132; // iad.xfr.dns.icann.org
|
||||
2620:0:2830:202::132; // iad.xfr.dns.icann.org
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
zone "arpa" {
|
||||
type slave;
|
||||
file "/usr/local/etc/namedb/slave/arpa.slave";
|
||||
masters {
|
||||
192.0.32.132; // lax.xfr.dns.icann.org
|
||||
2620:0:2d0:202::132; // lax.xfr.dns.icann.org
|
||||
192.0.47.132; // iad.xfr.dns.icann.org
|
||||
2620:0:2830:202::132; // iad.xfr.dns.icann.org
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
zone "in-addr.arpa" {
|
||||
type slave;
|
||||
file "/usr/local/etc/namedb/slave/in-addr.arpa.slave";
|
||||
masters {
|
||||
192.0.32.132; // lax.xfr.dns.icann.org
|
||||
2620:0:2d0:202::132; // lax.xfr.dns.icann.org
|
||||
192.0.47.132; // iad.xfr.dns.icann.org
|
||||
2620:0:2830:202::132; // iad.xfr.dns.icann.org
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
zone "ip6.arpa" {
|
||||
type slave;
|
||||
file "/usr/local/etc/namedb/slave/ip6.arpa.slave";
|
||||
masters {
|
||||
192.0.32.132; // lax.xfr.dns.icann.org
|
||||
2620:0:2d0:202::132; // lax.xfr.dns.icann.org
|
||||
192.0.47.132; // iad.xfr.dns.icann.org
|
||||
2620:0:2830:202::132; // iad.xfr.dns.icann.org
|
||||
};
|
||||
notify no;
|
||||
};
|
||||
*/
|
||||
|
||||
/* Serving the following zones locally will prevent any queries
|
||||
for these zones leaving your network and going to the root
|
||||
name servers. This has two significant advantages:
|
||||
1. Faster local resolution for your users
|
||||
2. No spurious traffic will be sent from your network to the roots
|
||||
*/
|
||||
// RFCs 1912, 5735 and 6303 (and BCP 32 for localhost)
|
||||
zone "localhost" { type master; file "/usr/local/etc/namedb/master/localhost-forward.db"; };
|
||||
zone "127.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/localhost-reverse.db"; };
|
||||
zone "255.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// RFC 1912-style zone for IPv6 localhost address (RFC 6303)
|
||||
zone "0.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/localhost-reverse.db"; };
|
||||
|
||||
// "This" Network (RFCs 1912, 5735 and 6303)
|
||||
zone "0.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// Private Use Networks (RFCs 1918, 5735 and 6303)
|
||||
zone "10.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "16.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "17.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "18.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "19.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "20.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "21.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "22.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "23.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "24.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "25.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "26.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "27.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "28.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "29.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "30.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "31.172.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "168.192.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// Shared Address Space (RFC 6598)
|
||||
zone "64.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "65.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "66.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "67.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "68.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "69.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "70.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "71.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "72.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "73.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "74.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "75.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "76.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "77.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "78.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "79.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "80.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "81.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "82.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "83.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "84.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "85.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "86.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "87.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "88.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "89.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "90.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "91.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "92.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "93.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "94.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "95.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "96.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "97.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "98.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "99.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "100.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "101.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "102.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "103.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "104.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "105.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "106.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "107.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "108.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "109.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "110.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "111.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "112.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "113.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "114.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "115.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "116.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "117.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "118.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "119.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "120.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "121.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "122.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "123.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "124.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "125.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "126.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "127.100.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// Link-local/APIPA (RFCs 3927, 5735 and 6303)
|
||||
zone "254.169.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IETF protocol assignments (RFCs 5735 and 5736)
|
||||
zone "0.0.192.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// TEST-NET-[1-3] for Documentation (RFCs 5735, 5737 and 6303)
|
||||
zone "2.0.192.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "100.51.198.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "113.0.203.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IPv6 Example Range for Documentation (RFCs 3849 and 6303)
|
||||
zone "8.b.d.0.1.0.0.2.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// Router Benchmark Testing (RFCs 2544 and 5735)
|
||||
zone "18.198.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "19.198.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IANA Reserved - Old Class E Space (RFC 5735)
|
||||
zone "240.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "241.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "242.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "243.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "244.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "245.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "246.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "247.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "248.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "249.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "250.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "251.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "252.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "253.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "254.in-addr.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IPv6 Unassigned Addresses (RFC 4291)
|
||||
zone "1.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "3.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "4.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "5.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "6.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "7.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "8.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "9.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "a.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "b.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "c.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "d.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "e.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "0.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "1.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "2.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "3.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "4.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "5.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "6.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "7.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "8.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "9.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "a.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "b.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "0.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "1.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "2.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "3.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "4.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "5.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "6.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "7.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IPv6 ULA (RFCs 4193 and 6303)
|
||||
zone "c.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "d.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IPv6 Link Local (RFCs 4291 and 6303)
|
||||
zone "8.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "9.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "a.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "b.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IPv6 Deprecated Site-Local Addresses (RFCs 3879 and 6303)
|
||||
zone "c.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "d.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "e.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
zone "f.e.f.ip6.arpa" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// IP6.INT is Deprecated (RFC 4159)
|
||||
zone "ip6.int" { type master; file "/usr/local/etc/namedb/master/empty.db"; };
|
||||
|
||||
// NB: Do not use the IP addresses below, they are faked, and only
|
||||
// serve demonstration/documentation purposes!
|
||||
//
|
||||
// Example slave zone config entries. It can be convenient to become
|
||||
// a slave at least for the zone your own domain is in. Ask
|
||||
// your network administrator for the IP address of the responsible
|
||||
// master name server.
|
||||
//
|
||||
// Do not forget to include the reverse lookup zone!
|
||||
// This is named after the first bytes of the IP address, in reverse
|
||||
// order, with ".IN-ADDR.ARPA" appended, or ".IP6.ARPA" for IPv6.
|
||||
//
|
||||
// Before starting to set up a master zone, make sure you fully
|
||||
// understand how DNS and BIND work. There are sometimes
|
||||
// non-obvious pitfalls. Setting up a slave zone is usually simpler.
|
||||
//
|
||||
// NB: Don't blindly enable the examples below. :-) Use actual names
|
||||
// and addresses instead.
|
||||
|
||||
/* An example dynamic zone
|
||||
key "exampleorgkey" {
|
||||
algorithm hmac-md5;
|
||||
secret "sf87HJqjkqh8ac87a02lla==";
|
||||
};
|
||||
zone "example.org" {
|
||||
type master;
|
||||
allow-update {
|
||||
key "exampleorgkey";
|
||||
};
|
||||
file "/usr/local/etc/namedb/dynamic/example.org";
|
||||
};
|
||||
*/
|
||||
|
||||
/* Example of a slave reverse zone
|
||||
zone "1.168.192.in-addr.arpa" {
|
||||
type slave;
|
||||
file "/usr/local/etc/namedb/slave/1.168.192.in-addr.arpa";
|
||||
masters {
|
||||
192.168.1.1;
|
||||
};
|
||||
};
|
||||
*/
|
|
@ -1,8 +0,0 @@
|
|||
# DO NOT EDIT THIS FILE - edit the master and reinstall.
|
||||
# (/tmp/crontab.q40BAzenoV installed on Sun Apr 18 22:56:27 2021)
|
||||
# (Cron version -- $FreeBSD$)
|
||||
# monthly zpool scrub
|
||||
0 2 1 * * /sbin/zpool scrub zrootmirror
|
||||
|
||||
# nightly config backup
|
||||
0 3 * * * /root/fw/backup.sh
|
172
README.md
172
README.md
|
@ -1,8 +1,17 @@
|
|||
# About
|
||||
|
||||
This repository includes my notes on enabling a true bridge mode setup with AT&T U-Verse and pfSense. This method utilizes [netgraph](https://www.freebsd.org/cgi/man.cgi?netgraph(4)) 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.
|
||||
This repository includes my notes on enabling a true bridge mode setup with AT&T U-Verse and OPNsense. This method utilizes [netgraph](https://www.freebsd.org/cgi/man.cgi?netgraph(4)) 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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Residential Gateway
|
||||
|
||||
AT&T currently offers a variety of residential gateways to their fiber customers. Depending on what was available at the time of your install, you may have one of these models:
|
||||
|
||||
- Motorola NVG589
|
||||
- Arris NVG599
|
||||
- Arris BGW210
|
||||
- Pace 5268AC
|
||||
|
||||
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).
|
||||
|
||||
|
@ -23,18 +32,26 @@ First, let's talk about what happens in the standard setup (without any bypass).
|
|||
|
||||
## Bypass Procedure
|
||||
|
||||
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.
|
||||
To bypass the gateway using OPNsense, we can emulate the standard procedure. If we connect our Residential Gateway and ONT to our OPNsense 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:
|
||||
|
||||
#### Bridge Method
|
||||
|
||||
If we connect our residential gateway and ONT to our pfSense box, we can bridge the 802.1X EAP-TLS authentication traffic, tag our WAN traffic as VLAN ID 0, and request a public IPv4 via DHCP using a MAC address that matches our assigned residential gateway.
|
||||
|
||||
Unfortunately, there are some challenges with emulating this process. First, it's against RFC to bridge 802.1X traffic and it is not supported in FreeBSD. Second, tagging traffic as VLAN ID 0 is also 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]
|
||||
[nic0] OPNsense [nic1]
|
||||
|
|
||||
|
|
||||
[ONT]
|
||||
|
@ -45,34 +62,89 @@ With netgraph, our procedure looks like this (at a high level):
|
|||
|
||||
1. The Residential Gateway initiates a 802.1/X EAPOL-START.
|
||||
1. The packet then is bridged through netgraph to the ONT interface.
|
||||
1. If the packet matches an 802.1/X type (which is does), it is passed to the ONT interface. If it does not, the packet is discarded. This prevents our Residential Gateway from initiating DHCP. We want pfSense to handle that.
|
||||
1. If the packet matches an 802.1/X type (which is does), it is passed to the ONT interface. If it does not, the packet is discarded. This prevents our Residential Gateway from initiating DHCP. We want OPNsense to handle that.
|
||||
1. The ONT should then see and respond to the EAPOL-START, which is passed back through our netgraph back to the residential gateway. At this point, the 802.1/X authentication should be complete.
|
||||
1. netgraph has also created an interface for us called `ngeth0`. This interface is connected to `ng_vlan` which is configured to tag all traffic as VLAN0 before sending it on to the ONT interface.
|
||||
1. pfSense can then be configured to use `ngeth0` as the WAN interface.
|
||||
1. OPNsense can then be configured to use `ngeth0` as the WAN interface.
|
||||
1. Next, we spoof the MAC address of the residential gateway and request a DHCP lease on `ngeth0`. The packets get tagged as VLAN0 and exit to the ONT.
|
||||
1. Now the DHCP handshake should complete and we should be on our way!
|
||||
|
||||
#### Supplicant Method
|
||||
|
||||
Alternatively, if you have valid certs that have been extracted from an authorized residential gateway device, you can utilize the native wpa_supplicant client in pfSense to perform 802.1X EAP-TLS authentication.
|
||||
|
||||
I will also note that EAP-TLS authentication authorizes the device, not the subscriber. Meaning, any authorized device (NVG589, NVG599, 5268AC, BGW210, etc) can be used to authorize the link. It does not have to match the RG assigned to your account. For example, an NVG589 purchased of eBay can authorize the link. The subscriber's *service* is authorized separately (probably by the DHCP MAC and/or ONT serial number).
|
||||
|
||||
In supplicant mode, the residential gateway can be permanently disconnected. We will still use netgraph to tag our traffic with VLAN0. Our cabling then looks pretty simple:
|
||||
|
||||
```
|
||||
Outside[ONT]---[nic0]pfsense
|
||||
```
|
||||
|
||||
With netgraph, the procedure also looks a little simpler:
|
||||
|
||||
1. netgraph has created an interface for us called `ngeth0`. This interface is connected to `ng_vlan` which is configured to tag all traffic as VLAN0 before sending it on to the ONT interface.
|
||||
2. wpa_supplicant binds to `ngeth0` and initiates 802.1X EAP-TLS authentication
|
||||
3. pfSense can then be configured to use `ngeth0` as the WAN interface.
|
||||
4. Next, we spoof the MAC address of the residential gateway and request a DHCP lease on `ngeth0`. The packets get tagged as VLAN0 and exit to the ONT.
|
||||
5. Now the DHCP handshake should complete and we should be on our way!
|
||||
|
||||
Hopefully, that now gives you an idea of what we are trying to accomplish. See the comments and commands `bin/pfatt.sh` for details about the netgraph setup.
|
||||
|
||||
But enough talk. Now for the fun part!
|
||||
|
||||
Hopefully, that now gives you an idea of what we are trying to accomplish. See the comments and commands `bin/pfatt.sh` for details about the netgraph setup.
|
||||
|
||||
But enough talk. Now for the fun part!
|
||||
|
||||
# Setup
|
||||
|
||||
First, you need to decide which method to perform EAP authentication: bridge mode or supplicant mode.
|
||||
|
||||
Both methods effectively give you the same result, but each have their advantages and disadvantages.
|
||||
|
||||
**Bridge EAP-TLS**
|
||||
|
||||
`EAP_MODE="bridge"`
|
||||
|
||||
✅ Easiest method
|
||||
|
||||
❌ Requires Residential Gateway to always be plugged in and on
|
||||
|
||||
❌ Authentication can be slower and less reliable
|
||||
|
||||
❌ The 5268AC model requires a hacky workaround
|
||||
|
||||
**Supplicant EAP-TLS**
|
||||
|
||||
`EAP_MODE="supplicant"`
|
||||
|
||||
✅ Residential Gateway can be permanently off and stored
|
||||
|
||||
✅ Fast and stable authentication
|
||||
|
||||
❌ May be difficult for some. Requires extracting valid certificates from a Residential Gateway
|
||||
|
||||
Pick a mode then proceed to confirming that you have your prerequisites.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* At least __three__ physical network interfaces on your pfSense server
|
||||
* The MAC address of your Residential Gateway
|
||||
* Local or console access to pfSense
|
||||
* pfSense 2.4.5 running on amd64 architecture _(If you are running pfSense 2.4.4 please see instruction in the [Before-pfSense-2.4.5 branch](https://github.com/MonkWho/pfatt/blob/Before-pfSense-2.4.5/README.md))_
|
||||
* The MAC address of your assigned Residential Gateway
|
||||
* pfSense 2.4.x
|
||||
|
||||
At this time there is a bug in pFsense 2.4.5 and [ng_etf module is only included in pFsense 2.4.5 _amd64 build_](
|
||||
https://redmine.pfsense.org/issues/10463). Should be fixed in 2.4.5-p1.
|
||||
For bridge mode:
|
||||
|
||||
PFSense Builds for Netgate hardware may not include ng_etf (Confimred on SG4860-Desktop 2.4.5-p1). Confirm ng_etf exists before continuing and look at [Before-pfSense-2.4.5 branch](https://github.com/MonkWho/pfatt/blob/Before-pfSense-2.4.5/README.md) for gudiance if it doesn't exist.
|
||||
* __three__ physical network interfaces on your pfSense server
|
||||
|
||||
If you are running pfSense on anything other than amd64 architecture you should compile your own version of ng_etf. Look at [Before-pfSense-2.4.5 branch](https://github.com/MonkWho/pfatt/blob/Before-pfSense-2.4.5/README.md) for some guidance on compiling and running your own ng_etf.
|
||||
For supplicant mode:
|
||||
|
||||
If you only have two NICs, you can buy this cheap USB 100Mbps NIC [from Amazon](https://www.amazon.com/gp/product/B00007IFED) as your third. It has the Asix AX88772 chipset, which is supported in FreeBSD with the [axe](https://www.freebsd.org/cgi/man.cgi?query=axe&sektion=4) 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.
|
||||
* __two__ physical network interfaces on your pfSense server
|
||||
* The MAC address of your EAP-TLS Identity (which is the same as your residential gateway if you are using its certificates)
|
||||
* Valid certificates to perform EAP-TLS authentication (see **Extracting Certificates**)
|
||||
|
||||
If you only have two NICs, you can buy this cheap USB 100Mbps NIC [from Amazon](https://www.amazon.com/gp/product/B00007IFED) as your third. It has the Asix AX88772 chipset, which is supported in FreeBSD with the [axe](https://www.freebsd.org/cgi/man.cgi?query=axe&sektion=4) 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.
|
||||
|
||||
## Install
|
||||
|
||||
|
@ -83,29 +155,20 @@ If you only have two NICs, you can buy this cheap USB 100Mbps NIC [from Amazon](
|
|||
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx' # MAC address of Residential Gateway
|
||||
```
|
||||
|
||||
2. Copy `bin/pfatt.sh` to `/root/bin` (or any directory):
|
||||
2. Copy `bin/opnatt.sh` to `/user/local/etc/rc.syshook.d/early/99-opnatt.sh` (or any directory):
|
||||
```
|
||||
ssh root@pfsense mkdir /root/bin
|
||||
scp bin/pfatt.sh root@pfsense:/root/bin/
|
||||
ssh root@pfsense chmod +x /root/bin/pfatt.sh
|
||||
scp bin/pfatt.sh root@OPNsense:/user/local/etc/rc.syshook.d/early/99-opnatt.sh
|
||||
ssh root@OPNsense chmod +x /user/local/etc/rc.syshook.d/early/99-opnatt.sh
|
||||
```
|
||||
|
||||
**NOTE:** If you have the 5268AC, you'll also need to install `pfatt-5268AC-startup.sh` and `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 `PING_HOST` in `pfatt-5268AC.sh` to a reliable host. Then perform these additional steps to install:
|
||||
```
|
||||
scp bin/pfatt-5268AC-startup.sh root@pfsense:/usr/local/etc/rc.d/pfatt-5268AC-startup.sh
|
||||
scp bin/pfatt-5268AC.sh root@pfsense:/root/bin/
|
||||
ssh root@pfsense chmod +x /usr/local/etc/rc.d/pfatt-5268AC-startup.sh /root/bin/pfatt-5268AC.sh
|
||||
scp bin/pfatt-5268AC-startup.sh root@OPNsense:/usr/local/etc/rc.d/pfatt-5268AC-startup.sh
|
||||
scp bin/pfatt-5268AC.sh root@OPNsense:/root/bin/
|
||||
ssh root@OPNsense chmod +x /usr/local/etc/rc.d/pfatt-5268AC-startup.sh /root/bin/pfatt-5268AC.sh
|
||||
```
|
||||
|
||||
3. 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: earlyshellcmd
|
||||
```
|
||||
It should look like this:
|
||||

|
||||
|
||||
This can also be acomplished by manually editing your pfSense /conf/config.xml file. Add <earlyshellcmd>/root/bin/pfatt.sh</earlyshellcmd> above </system>. This method is not recommended and is frowned upon by pfSense team.
|
||||
3. The pfatt.sh script will start with the boot process due to it's placement in /user/local/etc/rc.syshook.d/early/.
|
||||
|
||||
4. Connect cables:
|
||||
- `$RG_IF` to Residential Gateway on the ONT port (not the LAN ports!)
|
||||
|
@ -114,7 +177,7 @@ If you only have two NICs, you can buy this cheap USB 100Mbps NIC [from Amazon](
|
|||
|
||||
5. Prepare for console access.
|
||||
6. Reboot.
|
||||
7. pfSense will detect new interfaces on bootup. Follow the prompts on the console to configure `ngeth0` as 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 `$RG_IF` or `$ONT_IF`. I would advise not enabling those interfaces in pfSense as it can cause problems with the netgraph.
|
||||
7. OPNsense will detect new interfaces on bootup. Follow the prompts on the console to configure `ngeth0` as your OPNsense 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. OPNsense does not need to manage `$RG_IF` or `$ONT_IF`. I would advise not enabling those interfaces in OPNsense as it can cause problems with the netgraph.
|
||||
8. 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.
|
||||
|
@ -123,16 +186,6 @@ If everything is setup correctly, netgraph should be bridging EAP traffic betwee
|
|||
|
||||
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](http://www.dslreports.com/forum/r32118263-) on DSLReports for sharing your notes.
|
||||
|
||||
This setup assumes you have a fairly recent version of pfSense. I'm using 2.4.5.
|
||||
|
||||
**DUID Setup**
|
||||
|
||||
1. Go to _System > Advanced > Networking_
|
||||
1. Configure **DHCP6 DUID** to _DUID-EN_
|
||||
1. Configure **DUID-EN** to _3561_
|
||||
1. Configure your **IANA Private Enterprise Number**. This number is unique for each customer and (I believe) based off your Residential Gateway serial number. You can generate your DUID using [gen-duid.sh](https://github.com/MonkWho/pfatt/blob/master/bin/gen-duid.sh), which just takes a few inputs. Or, you can take a pcap of the Residential Gateway with some DHCPv6 traffic. Then fire up Wireshark and look for the value in _DHCPv6 > Client Identifier > Identifier_. Add the value as colon separated hex values `00:00:00`.
|
||||
1. Save
|
||||
|
||||
**WAN Setup**
|
||||
|
||||
1. Go to _Interfaces > WAN_
|
||||
|
@ -149,7 +202,7 @@ This setup assumes you have a fairly recent version of pfSense. I'm using 2.4.5.
|
|||
1. Go to _Interfaces > LAN_
|
||||
1. Change the **IPv6 Configuration Type** to _Track Interface_
|
||||
1. Under Track IPv6 Interface, assign **IPv6 Interface** to your WAN interface.
|
||||
1. Configure **IPv6 Prefix ID** to _1_. We start at _1_ and not _0_ because pfSense will use prefix/address ID _0_ for itself and it seems AT&T is flakey about assigning IPv6 prefixes when a request is made with a prefix ID that matches the prefix/address ID of the router.
|
||||
1. Configure **IPv6 Prefix ID** to _0_. You *CAN* use IPv6 Prefix id 0, as OPNSense does *NOT* assign a routeable IPv6 address to ngeth0
|
||||
1. Save
|
||||
|
||||
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.
|
||||
|
@ -205,7 +258,7 @@ Verify you are seeing 802.1Q (tagged as vlan0) traffic on your `$ONT_IF ` interf
|
|||
|
||||
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. `ngeth0` needs to DHCP using the authorized MAC address. You should see an untagged DCHP request on `ngeth0` carry over to the `$ONT_IF` interface tagged as VLAN0. Then you should get a DHCP response and you're in business.
|
||||
If the VLAN0 traffic is being properly handled, next OPNsense will need to request an IP. `ngeth0` needs to DHCP using the authorized MAC address. You should see an untagged DCHP request on `ngeth0` carry over to the `$ONT_IF` interface tagged as VLAN0. Then you should get a DHCP response and you're in business.
|
||||
|
||||
If you don't see traffic being bridged between `ngeth0` and `$ONT_IF`, then netgraph is not setup correctly.
|
||||
|
||||
|
@ -271,10 +324,6 @@ $ ngctl show ue0:
|
|||
/usr/sbin/ngctl shutdown ngeth0:
|
||||
```
|
||||
|
||||
## pfSense
|
||||
|
||||
In some circumstances, pfSense may alter your netgraph. This is especially true if pfSense manages either your `$RG_IF` or `$ONT_IF`. If you make some interface changes and your connection breaks, check to see if your netgraph was changed.
|
||||
|
||||
# Virtualization Notes
|
||||
|
||||
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.
|
||||
|
@ -301,32 +350,9 @@ There is a whole thread on this at [DSLreports](http://www.dslreports.com/forum/
|
|||
|
||||
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.
|
||||
|
||||
## OPNSense
|
||||
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 `/usr/local/etc/rc.syshook.d/early` as `99-opnatt.sh`
|
||||
4) 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
|
||||
## FreeBSD
|
||||
|
||||
## FreeBSD (tested on 13.0-RELEASE)
|
||||
For FreeBSD:
|
||||
1) use file freeatt.sh
|
||||
2) ng_etf.ko is not needed, standard FreeBSD includes all of the required modules
|
||||
3) modules can be loaded from /boot/loader.conf, an example loader.conf with the modules listed is included (loading modules in the script should work, but lets do things "properly")
|
||||
4) put the freeatt.sh script into '/etc' and rename to `start_if.$ONT_IF` in my case the file is `/etc/start_if.igb0` this will depend on your hardware
|
||||
5) in rc.conf, add the line `ifconfig_$ONT_IF=""` this will trigger rc to run our start_if.$ONT_IF script to create the ngeth0 interface, and then do nothing else to the interface, in my case this line is `ifconfig_igb0=""` (using $RG_IF instead probably gives the same result)
|
||||
6) configure the rest of rc.conf, an example is provided with the essentials, gateway_enable, DHCP settings etc.
|
||||
7) configure pf, dhcpd, etc. to taste, generic examples provided
|
||||
|
||||
Once you have IPv4 connectivity you're done, unless you want IPv6 as well. The default dhclient still does not support IPv6, so:
|
||||
1) Install KAME dhcp6c 'pkg install dhcp6'
|
||||
2) Configure rc.conf with 'ipv6_cpe_wanif="ngeth0"' in addition to the other ipv6, dhcp6c, and rtadvd configuration in rc.conf, filling in with your lan interface(s)
|
||||
3) use the example configuration in `/usr/local/etc/dhcp6c.conf` to configure dhcp6c
|
||||
4) Set some inet6 rules in pf.conf and test
|
||||
|
||||
Example configuration files are provided for bind, dhcpd, dhcpd6, rtadvd, etc. based off of a currently working dual stack router running FreeBSD 13, other versions of FreeBSD may work
|
||||
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.
|
||||
|
||||
# U-verse TV
|
||||
|
||||
|
|
176
U-VERSE_TV.md
176
U-VERSE_TV.md
|
@ -1,176 +0,0 @@
|
|||
# U-verse TV
|
||||
|
||||
If you have a U-verse TV subscription, you will need to perform some additional setup in order to get it working with your new pfSense system in-line with the residential gateway (RG).
|
||||
|
||||
## Preface
|
||||
|
||||
This guide was intially written by [0xC0ncord](https://github.com/0xC0ncord) in conjunction with the setup detailed by [/u/MisterBazz](https://www.reddit.com/r/PFSENSE/comments/ag43rb/att_bgw210_true_independent_bridge_mode_uverse/) and my personal experience in getting this entire setup working properly. The reason why I am mentioning this is to ~~shamelessly credit myself~~ make note that [aus had previously stated he does not have a TV subscription](https://github.com/aus/pfatt/issues/3#issue-362961147) at the time of writing and that there may be a disconnect between my point of view and his. Therefore, I want to point out that this portion of the guide is a community effort, and if you run into any issues or need assistance even after [troubleshooting](#Troubleshooting), please do not be afraid to ask for support.
|
||||
|
||||
## Overview / Prerequisites
|
||||
|
||||
Bypassing your AT&T residential gateway (RG) for U-verse TV is mostly straightforward (albeit sometimes a pain) from here on, but there is one major consideration that needs to be addressed.
|
||||
|
||||
U-verse TV streams are received through both IPv4 unicast and multicast streams. When selecting a channel through the Digital Video Receiver (DVR), the DVR will request the channel video stream while simultaneously sending an IGMP membership report and will receive the unicast stream for approximately 10 seconds before seamlessly switching to multicast. The amount of bandwidth consumed by the digital video stream for TV in general is a force to be reckoned with, and depending on how you choose to proceed with the setup may introduce noticeable network degradation. Because of the way IPv4 multicast traffic operates, you will end up in a situation where digital video traffic is being propogated throughout your network in ways that may not be desireable.To quote [/u/MisterBazz](https://www.reddit.com/r/PFSENSE/comments/ag43rb/att_bgw210_true_independent_bridge_mode_uverse/) on where I obtained most of this documentation, "it is way easier to set up a whole separate U-verse LAN than to pump all of this through your switch and configure the switch appropriately. It also makes it easy in setting up firewall rules as well."
|
||||
|
||||
For this guide, there are two paths to take:
|
||||
1. Isolate the DVR on its own internal network (recommended).
|
||||
2. Keep the DVR on the same internal LAN.
|
||||
|
||||
The prerequisites and so forth for each of these are documented below in their respective sections. Personally, I chose to put the DVR in its own network and so I cannot say for sure whether not doing so would actually result in noticeable network degradation, but your mileage may vary depending on your setup.
|
||||
|
||||
In summary, these are the basic steps performed by the DVR when selecting a channel to watch:
|
||||
1. The DVR requests the unicast stream and sends an IGMP membership report for the desired channel.
|
||||
2. The DVR begins playing the unicast stream and waits for the multicast stream.
|
||||
3. The DVR begins receiving the multicast stream and stops receiving the unicast stream after approximately 10 seconds of video output.
|
||||
4. Periodically, the DVR receives an IGMP general membership query from AT&T's network and will respond with another IGMP membership report while the channel is still being watched.
|
||||
|
||||
If the DVR were to change channels, it sends an IGMP leave group message for the current channel and repeats the steps above for the new channel.
|
||||
|
||||
On a final note, you need to ensure that the U-verse TV DVR you have supports IP video input. At the time of writing, I was unable to find any documentation of any sort of U-verse DVR that did not support this, especially since the manuals for them did not explicitly say so. In my case, I had an AT&T/Motorola VIP 2250, which was previously receiving video via a coaxial cable plugged into the back of the residential gateway before doing this setup. The manual for this particular DVR documents the RJ45 port on the back of the device but states it is for output and says nothing about input. After a little Google-fu I just barely confirmed my suspicious that this port could also be used for video input, but your DVR may be different if you have a different model.
|
||||
|
||||
With all that mess out of the way, let's get started!
|
||||
|
||||
## Setup
|
||||
|
||||
Refer to the above two paths and pick whichever works for you.
|
||||
|
||||
### Isolate the DVR on its Own Internal Network (Recommended)
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
Since we will be plugging the DVR more or less directly into your pfSense box, you will need an additional physical interface. If you followed the rest of the pfatt guide, this brings the total number of required interfaces to **4**. Obviously, this means you must also have a way to physically connect the RJ45 port on your DVR to the interface on your pfSense box. The coaxial port on your DVR will no longer be needed if you were using it previously.
|
||||
|
||||
#### Setup
|
||||
|
||||
1. Re-cable your DVR.
|
||||
- Start by unplugging the coaxial cable from the back of the DVR if you are using it. You may as well unplug the coaxial cable from the back of your residential gateway as well.
|
||||
- Connect your DVR to your pfSense box using the RJ45 port on the back next to the coaxial port.
|
||||
2. Configure the UVerseDVR interface.
|
||||
1. On pfSense, navigate to _Interfaces > Interface Assignments_
|
||||
2. Under **Available network ports** find and add the interface you connected your DVR to. Take note of the name it is added as.
|
||||
3. Navigate to the interface's configuration by going to _Interfaces > (Newly created interface)_
|
||||
4. Change the interface's description to something more meaningful. I chose `UverseDVR`
|
||||
5. Ensure that **Enable** is checked.
|
||||
6. Set your pfSense's static IPv4 address for this new interface under **Static IPv4 Configuration**. This should be an RFC 1918 address that is not already in use on any other LAN in your network. You should also keep the size of the network relatively small. I chose `10.5.5.1/29`.
|
||||
7. Hit **Save**
|
||||
3. Configure the DHCP server on the DVR interface.
|
||||
1. Navigate to _Services > DHCP Server_
|
||||
2. Select the DVR interface tab.
|
||||
3. Check **Enable**
|
||||
4. Configure the DHCP address range in **Range**. Make sure this range is inside the network you allocated in step 2-6. I chose `10.5.5.2` - `10.5.5.5`
|
||||
5. Enter AT&T's DNS servers in **DNS Servers** (optional but highly recommended):
|
||||
- `68.94.156.1`
|
||||
- `68.94.157.1`
|
||||
(These may be different depending on your location)
|
||||
6. Hit **Save**
|
||||
4. Configure the IGMP Proxy.
|
||||
1. Navigate to _Services > IGMP Proxy_
|
||||
2. Check **Enable IGMP**
|
||||
3. Click **Add**
|
||||
4. Select your WAN interface under **Interface**
|
||||
5. Enter a meaningful description if you so choose. I used `U-verse IPTV`
|
||||
6. Set **Type** to `Upstream interface`
|
||||
7. For _Networks_, enter `0.0.0.1/1`
|
||||
8. Hit **Save**
|
||||
9. Click **Add**
|
||||
10. Select your DVR interface under **Interface**
|
||||
11. Enter a meaningful description if you so choose. I used `U-verse IPTV`
|
||||
12. Set **Type** to `Downstream interface`
|
||||
13. For **Networks**, enter the network you created in step 2-6. I chose `10.5.5.0/29`
|
||||
14. Hit **Save**
|
||||
5. Configure the firewall.
|
||||
1. Navigate to _Firewall > Rules_
|
||||
2. Select the _Floating_ tab.
|
||||
3. Create a rule as follows:
|
||||
- **Action**: `Pass`
|
||||
- **Quick**: `Checked`
|
||||
- **Interface**: `WAN, UverseDVR`
|
||||
- **Protocol**: `Any`
|
||||
- **Destination**: `Network` `224.0.0.0/8`
|
||||
- **Description**: `Allow multicast to U-verse IPTV`
|
||||
- **Allow IP options**: `Checked`
|
||||
4. Create another rule as follows:
|
||||
- **Action**: `Pass`
|
||||
- **Quick**: `Checked`
|
||||
- **Interface**: `WAN, UverseDVR`
|
||||
- **Protocol**: `Any`
|
||||
- **Destination**: `Network` `239.0.0.0/8`
|
||||
- **Description**: `Allow multicast to U-verse IPTV`
|
||||
- **Allow IP options**: `Checked`
|
||||
5. Save and apply your new rules.
|
||||
|
||||
If you made it this far your new setup should be complete!
|
||||
|
||||
### Keep the DVR on the Same Internal LAN
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
If you were previously using the coaxial port on your DVR to connect it to your residential gateway, you will need to now connect your DVR to your LAN using the RJ45 next to it. The coaxial port on your DVR will no longer be needed if you were using it.
|
||||
|
||||
#### Setup
|
||||
1. Re-cable your DVR.
|
||||
- Start by unplugging the coaxial cable from the back of the DVR if you are using it. You may as well unplug the coaxial cable from the back of your residential gateway as well.
|
||||
- Connect your DVR to your LAN using the RJ45 port on the back next to the coaxial port.
|
||||
2. Create a static DHCP lease for the DVR.
|
||||
1. Go to _Services > DHCP Server > LAN_
|
||||
2. Under **DHCP Static Mappings for this Interface** choose **Add**
|
||||
3. Enter your DVR's MAC address in **MAC Address**
|
||||
4. Assign some IP address to the DVR in **IP Address**. It **must** be an IPv4 address.
|
||||
5. Enter AT&T's DNS servers in **DNS Servers** (optional but highly recommended):
|
||||
- `68.94.156.1`
|
||||
- `68.94.157.1`
|
||||
(These may be different depending on your location.)
|
||||
6. Hit **Save**
|
||||
3. Configure the IGMP Proxy.
|
||||
1. Navigate to _Services > IGMP Proxy_
|
||||
2. Check **Enable IGMP**
|
||||
3. Click **Add**
|
||||
4. Select your WAN interface under **Interface**
|
||||
5. Enter a meaningful description if you so choose. I used `U-verse IPTV`
|
||||
6. Set **Type** to `Upstream interface`
|
||||
7. For **Networks**, enter `0.0.0.1/1`
|
||||
8. Hit **Save**
|
||||
9. Click **Add**
|
||||
10. Select your LAN interface under **Interface**
|
||||
11. Enter a meaningful description if you so choose. I used `U-verse IPTV`
|
||||
12. Set **Type** to `Downstream interface`
|
||||
13. For **Networks**, enter the network address in CIDR notation of your LAN.
|
||||
14. Hit **Save**
|
||||
4. Configure the firewall.
|
||||
1. Navigate to _Firewall > Rules_
|
||||
2. Select the _Floating_ tab.
|
||||
3. Create a rule as follows:
|
||||
- **Action**: `Pass`
|
||||
- **Quick**: `Checked`
|
||||
- **Interface**: `WAN, LAN`
|
||||
- **Protocol**: `Any`
|
||||
- **Destination**: `Network` `224.0.0.0/8`
|
||||
- **Description**: `Allow multicast to U-verse IPTV`
|
||||
- **Allow IP options**: `Checked`
|
||||
4. Create another rule as follows:
|
||||
- **Action**: `Pass`
|
||||
- **Quick**: `Checked`
|
||||
- **Interface**: `WAN, LAN`
|
||||
- **Protocol**: `Any`
|
||||
- **Destination**: `Network 239.0.0.0/8`
|
||||
- **Description**: `Allow multicast to U-verse IPTV`
|
||||
- **Allow IP options**: `Checked`
|
||||
5. Save and apply your new rules.
|
||||
|
||||
If you made it this far your new setup should be complete!
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### My DVR isn't getting any channels!
|
||||
|
||||
Make sure that your DVR has a proper connection to the internet. Double-check your configuration and make sure that the DVR is allowed to receive traffic.
|
||||
|
||||
### I can select a channel and watch it, but after about 10 seconds the TV goes black or the video freezes!
|
||||
|
||||
This means your DVR isn't able to receive the multicast video stream. Recall that the first 10 seconds of watching a new channel are done via unicast while the DVR simultaneously requests IGMP membership, and then after about 10 seconds you should start seeing multicast traffic passing through your firewall. If you don't see multicast traffic at all, make sure that your IGMP proxy is setup correctly. It's possible that the server sending the video stream is not receiving your DVR's IGMP membership request. If you *do* see the multicast traffic, double-check your firewall rules and make sure that multicast traffic is allowed to pass and that it can reach the DVR.
|
||||
|
||||
## Afterthoughts
|
||||
|
||||
For the purposes of this guide, when configuring the upstream networks for the IGMP proxy, we entered `0.0.0.1/1`, when in fact this is just a catch-all for a majority of the IPv4 address space. While I was still doing my initial research on the proper setup for this, I could not find a definitive list of source IP addresses that AT&T's U-verse TV streams seem to come from, and other sources claimed there were just too many. The proper configuration for this would be to enter each of those networks/addresses, but I simply could not get an accurate list of them. If you're reading this and you would like to share your findings, please consider submitting an issue or pull request to edit this documentation.
|
||||
|
||||
If you did not isolate your DVR on its own network in your setup, you may need to configure additional network devices on your LAN if you have any. Since multicast traffic is now propogating throughout your LAN, if you are able to, you should do what is possible to limit the areas of your network where this traffic is allowed to propogate, especially if it is not needed except towards the DVR. This is especially true for wireless networks. Unfortunately, the exact procedures for doing this for each network device vary from vendor to vendor and are far beyond the scope of this guide, but the end goal is to simply disallow multicast traffic from passing through devices and into areas of the network where it is not needed.
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ONT_IF='xx0'
|
||||
RG_IF='xx1'
|
||||
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
|
||||
LOG=/var/log/freeatt.log
|
||||
|
||||
getTimestamp(){
|
||||
echo `date "+%Y-%m-%d %H:%M:%S :: [freeatt.sh] ::"`
|
||||
}
|
||||
|
||||
{
|
||||
echo "$(getTimestamp) FreeBSD pf + AT&T U-verse Residential Gateway for true bridge mode"
|
||||
echo "$(getTimestamp) Configuration: "
|
||||
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
||||
echo "$(getTimestamp) RG_IF: $RG_IF"
|
||||
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
||||
|
||||
echo "$(getTimestamp) building netgraph nodes..."
|
||||
|
||||
echo -n "$(getTimestamp) creating ng_one2many... "
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: one2many lower one
|
||||
/usr/sbin/ngctl name $ONT_IF:lower o2m
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) creating vlan node and interface... "
|
||||
/usr/sbin/ngctl mkpeer o2m: vlan many0 downstream
|
||||
/usr/sbin/ngctl name o2m:many0 vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $ONT_IF (ONT)... "
|
||||
/usr/sbin/ngctl mkpeer o2m: etf many1 downstream
|
||||
/usr/sbin/ngctl name o2m:many1 waneapfilter
|
||||
/usr/sbin/ngctl connect waneapfilter: $ONT_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $RG_IF (RG)... "
|
||||
/usr/sbin/ngctl mkpeer $RG_IF: etf lower downstream
|
||||
/usr/sbin/ngctl name $RG_IF:lower laneapfilter
|
||||
/usr/sbin/ngctl connect laneapfilter: $RG_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) bridging etf for $ONT_IF <-> $RG_IF... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining filters for EAP traffic... "
|
||||
/usr/sbin/ngctl msg waneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
/usr/sbin/ngctl msg laneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling one2many links... "
|
||||
/usr/sbin/ngctl msg o2m: setconfig "{ xmitAlg=2 failAlg=1 enabledLinks=[ 1 1 ] }"
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) removing waneapfilter:nomatch hook... "
|
||||
/usr/sbin/ngctl rmhook waneapfilter: nomatch
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $RG_IF interface... "
|
||||
/sbin/ifconfig $RG_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $ONT_IF interface... "
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $RG_IF... "
|
||||
/sbin/ifconfig $RG_IF promisc
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $ONT_IF... "
|
||||
/sbin/ifconfig $ONT_IF promisc
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) set mac address on ngeth0..."
|
||||
/sbin/ifconfig ngeth0 ether $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
|
||||
echo "$(getTimestamp) ngeth0 should now be available to configure as your pf WAN"
|
||||
echo "$(getTimestamp) done!"
|
||||
} >> $LOG
|
|
@ -6,13 +6,13 @@ printhexstring() { awk '{l=split($0,c,"");for(i=1;i<l-1;i=i+2)printf("%s:",subst
|
|||
echo
|
||||
echo "Step 1) RG information"
|
||||
echo
|
||||
while read -p " Manufacturer [1=Pace, 2=Motorola/Arris, 3=Nokia]: " mfg; do
|
||||
([ "$mfg" = "1" ] || [ "$mfg" = "2" ] || [ "$mfg" = "3" ]) && break
|
||||
while read -p " Manufacturer [1=Pace, 2=Motorola]: " mfg; do
|
||||
([ "$mfg" = "1" ] || [ "$mfg" = "2" ]) && break
|
||||
done
|
||||
while read -p " Serial number: " serial; do [ -n "$serial" ] && break; done
|
||||
echo
|
||||
|
||||
[ "$mfg" = "1" ] && mfg="00D09E" || [ "$mfg" = "2" ] && mfg="001E46" || [ "$mfg" = "3" ] && mfg="207852"
|
||||
[ "$mfg" = "1" ] && mfg="00D09E" || mfg="001E46"
|
||||
echo -n "Identifier: "
|
||||
ascii2hex "$mfg-$serial" | printhexstring
|
||||
|
||||
|
|
BIN
bin/ng_etf.ko
Normal file
BIN
bin/ng_etf.ko
Normal file
Binary file not shown.
292
bin/opnatt.sh
Normal file → Executable file
292
bin/opnatt.sh
Normal file → Executable file
|
@ -1,92 +1,238 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
#!/usr/bin/env sh
|
||||
#
|
||||
# CONFIG
|
||||
# ======
|
||||
#
|
||||
# ONT_IF Interface connected to the ONT
|
||||
#
|
||||
# RG_ETHER_ADDR MAC address of your assigned Residential Gateway
|
||||
#
|
||||
# EAP_MODE EAP authentication mode: supplicant or bridge
|
||||
#
|
||||
# supplicant Use wpa_supplicant to authorize your connection.
|
||||
# Requires valid certs in /conf/pfatt/wpa. No
|
||||
# Residential Gateway connection required.
|
||||
#
|
||||
# bridge Bridge EAPoL traffic from your Residential Gateway to
|
||||
# authorize your connection. Residential Gateway
|
||||
# connection required.
|
||||
#
|
||||
# EAP_SUPPLICANT_IDENTITY Required only with supplicant mode. MAC address associated
|
||||
# with your cert used as your EAP-TLS identity. If you extracted
|
||||
# the cert from your stock issue residential gateway, this is the
|
||||
# same as $RG_ETHER_ADDR.
|
||||
#
|
||||
# EAP_BRIDGE_IF Required only with bridge mode. Interface that is connected
|
||||
# to your Residential Gateway.
|
||||
#
|
||||
# EAP_BRIDGE_5268AC Required only with bridge mode. Enable workaround for 5268AC.
|
||||
# Enable if you have the 5268AC. See https://github.com/aus/pfatt/issues/5
|
||||
# for details. 0=OFF 1=ON
|
||||
#
|
||||
|
||||
ONT_IF='em0'
|
||||
RG_IF='em1'
|
||||
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
|
||||
LOG=/var/log/pfatt.log
|
||||
# Required Config
|
||||
# ===============
|
||||
ONT_IF="xx0"
|
||||
RG_ETHER_ADDR="xx:xx:xx:xx:xx:xx"
|
||||
EAP_MODE="bridge"
|
||||
|
||||
getTimestamp(){
|
||||
echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt.sh] ::"`
|
||||
}
|
||||
# Supplicant Config
|
||||
# =================
|
||||
EAP_SUPPLICANT_IDENTITY="xx:xx:xx:xx:xx:xx"
|
||||
|
||||
{
|
||||
echo "$(getTimestamp) pfSense + AT&T U-verse Residential Gateway for true bridge mode"
|
||||
echo "$(getTimestamp) Configuration: "
|
||||
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
||||
echo "$(getTimestamp) RG_IF: $RG_IF"
|
||||
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
||||
# Bridge Config
|
||||
# =============
|
||||
EAP_BRIDGE_IF="xx1"
|
||||
EAP_BRIDGE_5268AC=0
|
||||
|
||||
echo -n "$(getTimestamp) loading netgraph kernel modules... "
|
||||
/sbin/kldload -nq netgraph
|
||||
/sbin/kldload -nq ng_ether
|
||||
/sbin/kldload -nq ng_etf
|
||||
/sbin/kldload -nq ng_vlan
|
||||
/sbin/kldload -nq ng_eiface
|
||||
/sbin/kldload -nq ng_one2many
|
||||
echo "OK!"
|
||||
##### DO NOT EDIT BELOW #################################################################################
|
||||
|
||||
echo "$(getTimestamp) building netgraph nodes..."
|
||||
/usr/bin/logger -st "pfatt" "starting pfatt..."
|
||||
/usr/bin/logger -st "pfatt" "configuration:"
|
||||
/usr/bin/logger -st "pfatt" " ONT_IF = $ONT_IF"
|
||||
/usr/bin/logger -st "pfatt" " RG_ETHER_ADDR = $RG_ETHER_ADDR"
|
||||
/usr/bin/logger -st "pfatt" " EAP_MODE = $EAP_MODE"
|
||||
/usr/bin/logger -st "pfatt" " EAP_SUPPLICANT_IDENTITY = $EAP_SUPPLICANT_IDENTITY"
|
||||
/usr/bin/logger -st "pfatt" " EAP_BRIDGE_IF = $EAP_BRIDGE_IF"
|
||||
/usr/bin/logger -st "pfatt" " EAP_BRIDGE_5268AC = $EAP_BRIDGE_5268AC"
|
||||
|
||||
echo -n "$(getTimestamp) creating ng_one2many... "
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: one2many lower one
|
||||
/usr/sbin/ngctl name $ONT_IF:lower o2m
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "resetting netgraph..."
|
||||
/usr/sbin/ngctl shutdown waneapfilter: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown laneapfilter: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown $ONT_IF: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown $EAP_BRIDGE_IF: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown o2m: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown vlan0: >/dev/null 2>&1
|
||||
/usr/sbin/ngctl shutdown ngeth0: >/dev/null 2>&1
|
||||
|
||||
echo -n "$(getTimestamp) creating vlan node and interface... "
|
||||
/usr/sbin/ngctl mkpeer o2m: vlan many0 downstream
|
||||
/usr/sbin/ngctl name o2m:many0 vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
/sbin/kldload -nq netgraph
|
||||
/sbin/kldload -nq ng_ether
|
||||
/sbin/kldload -nq ng_vlan
|
||||
/sbin/kldload -nq ng_eiface
|
||||
/sbin/kldload -nq ng_one2many
|
||||
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
if [ "$EAP_MODE" = "bridge" ] ; then
|
||||
/usr/bin/logger -st "pfatt" "configuring EAP environment for $EAP_MODE mode..."
|
||||
/usr/bin/logger -st "pfatt" "cabling should look like this:"
|
||||
/usr/bin/logger -st "pfatt" " ONT---[] [$ONT_IF]$HOST[$EAP_BRIDGE_IF] []---[] [ONT_PORT]ResidentialGateway"
|
||||
/usr/bin/logger -st "pfatt" "loading netgraph kernel modules..."
|
||||
/sbin/kldload -nq ng_etf
|
||||
/usr/bin/logger -st "pfatt" "attaching interfaces to ng_ether..."
|
||||
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$ONT_IF');"
|
||||
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$EAP_BRIDGE_IF');"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $ONT_IF (ONT)... "
|
||||
/usr/sbin/ngctl mkpeer o2m: etf many1 downstream
|
||||
/usr/sbin/ngctl name o2m:many1 waneapfilter
|
||||
/usr/sbin/ngctl connect waneapfilter: $ONT_IF: nomatch upper
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "building netgraph nodes..."
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $RG_IF (RG)... "
|
||||
/usr/sbin/ngctl mkpeer $RG_IF: etf lower downstream
|
||||
/usr/sbin/ngctl name $RG_IF:lower laneapfilter
|
||||
/usr/sbin/ngctl connect laneapfilter: $RG_IF: nomatch upper
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "creating ng_one2many..."
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: one2many lower one
|
||||
/usr/sbin/ngctl name $ONT_IF:lower o2m
|
||||
|
||||
echo -n "$(getTimestamp) bridging etf for $ONT_IF <-> $RG_IF... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "creating vlan node and interface..."
|
||||
/usr/sbin/ngctl mkpeer o2m: vlan many0 downstream
|
||||
/usr/sbin/ngctl name o2m:many0 vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
|
||||
echo -n "$(getTimestamp) defining filters for EAP traffic... "
|
||||
/usr/sbin/ngctl msg waneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
/usr/sbin/ngctl msg laneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "defining etf for $ONT_IF (ONT)..."
|
||||
/usr/sbin/ngctl mkpeer o2m: etf many1 downstream
|
||||
/usr/sbin/ngctl name o2m:many1 waneapfilter
|
||||
/usr/sbin/ngctl connect waneapfilter: $ONT_IF: nomatch upper
|
||||
|
||||
echo -n "$(getTimestamp) enabling one2many links... "
|
||||
/usr/sbin/ngctl msg o2m: setconfig "{ xmitAlg=2 failAlg=1 enabledLinks=[ 1 1 ] }"
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "defining etf for $EAP_BRIDGE_IF (RG)... "
|
||||
/usr/sbin/ngctl mkpeer $EAP_BRIDGE_IF: etf lower downstream
|
||||
/usr/sbin/ngctl name $EAP_BRIDGE_IF:lower laneapfilter
|
||||
/usr/sbin/ngctl connect laneapfilter: $EAP_BRIDGE_IF: nomatch upper
|
||||
|
||||
echo -n "$(getTimestamp) removing waneapfilter:nomatch hook... "
|
||||
/usr/sbin/ngctl rmhook waneapfilter: nomatch
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "bridging etf for $ONT_IF <-> $EAP_BRIDGE_IF... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
|
||||
echo -n "$(getTimestamp) enabling $RG_IF interface... "
|
||||
/sbin/ifconfig $RG_IF up
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "defining filters for EAP traffic... "
|
||||
/usr/sbin/ngctl msg waneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
/usr/sbin/ngctl msg laneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
|
||||
echo -n "$(getTimestamp) enabling $ONT_IF interface... "
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "enabling one2many links... "
|
||||
/usr/sbin/ngctl msg o2m: setconfig "{ xmitAlg=2 failAlg=1 enabledLinks=[ 1 1 ] }"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $RG_IF... "
|
||||
/sbin/ifconfig $RG_IF promisc
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "removing waneapfilter:nomatch hook... "
|
||||
/usr/sbin/ngctl rmhook waneapfilter: nomatch
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $ONT_IF... "
|
||||
/sbin/ifconfig $ONT_IF promisc
|
||||
echo "OK!"
|
||||
/usr/bin/logger -st "pfatt" "enabling interfaces..."
|
||||
/sbin/ifconfig $EAP_BRIDGE_IF up
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
|
||||
echo "$(getTimestamp) ngeth0 should now be available to configure as your pfSense WAN"
|
||||
echo "$(getTimestamp) done!"
|
||||
} >> $LOG
|
||||
/usr/bin/logger -st "pfatt" "enabling promiscuous mode..."
|
||||
/sbin/ifconfig $EAP_BRIDGE_IF promisc
|
||||
/sbin/ifconfig $ONT_IF promisc
|
||||
|
||||
logger -st "pfatt" "waiting for EAP to complete authorization (unimplemented!)..."
|
||||
# TODO: detect, wait for EAP
|
||||
# TODO: force DHCP if needed
|
||||
|
||||
if [ "$EAP_BRIDGE_5268AC" = "1" ] ; then
|
||||
# install proper rc script
|
||||
/bin/cp /conf/pfatt/bin/pfatt-5268AC.rc /usr/local/etc/rc.d/pfatt-5268AC.sh
|
||||
# kill any existing pfatt-5268AC process
|
||||
PID=$(pgrep -f "pfatt-5268AC")
|
||||
if [ ${PID} > 0 ]; then
|
||||
/usr/bin/logger -st "pfatt" "terminating existing pfatt-5268AC on PID ${PID}..."
|
||||
RES=$(kill ${PID})
|
||||
/usr/local/etc/rc.d/pfatt-5268AC.sh stop
|
||||
fi
|
||||
/usr/bin/logger -st "pfatt" "enabling 5268AC workaround..."
|
||||
/usr/local/etc/rc.d/pfatt-5268AC.sh start
|
||||
fi
|
||||
/usr/bin/logger -st "pfatt" "ngeth0 should now be available to configure as your WAN..."
|
||||
/usr/bin/logger -st "pfatt" "done!"
|
||||
|
||||
elif [ "$EAP_MODE" = "supplicant" ] ; then
|
||||
/usr/bin/logger -st "pfatt" "configuring EAP environment for $EAP_MODE mode..."
|
||||
/usr/bin/logger -st "pfatt" "cabling should look like this:"
|
||||
/usr/bin/logger -st "pfatt" " ONT---[] [$ONT_IF]$HOST"
|
||||
/usr/bin/logger -st "pfatt" "creating vlan node and ngeth0 interface..."
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: vlan lower downstream
|
||||
/usr/sbin/ngctl name $ONT_IF:lower vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
|
||||
/usr/bin/logger -st "pfatt" "enabling promisc for $ONT_IF..."
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
/sbin/ifconfig $ONT_IF promisc
|
||||
|
||||
/usr/bin/logger -st "pfatt" "starting wpa_supplicant..."
|
||||
|
||||
WPA_PARAMS="\
|
||||
set eapol_version 2,\
|
||||
set fast_reauth 1,\
|
||||
ap_scan 0,\
|
||||
add_network,\
|
||||
set_network 0 ca_cert \\\"/conf/pfatt/wpa/ca.pem\\\",\
|
||||
set_network 0 client_cert \\\"/conf/pfatt/wpa/client.pem\\\",\
|
||||
set_network 0 eap TLS,\
|
||||
set_network 0 eapol_flags 0,\
|
||||
set_network 0 identity \\\"$EAP_SUPPLICANT_IDENTITY\\\",\
|
||||
set_network 0 key_mgmt IEEE8021X,\
|
||||
set_network 0 phase1 \\\"allow_canned_success=1\\\",\
|
||||
set_network 0 private_key \\\"/conf/pfatt/wpa/private.pem\\\",\
|
||||
enable_network 0\
|
||||
"
|
||||
|
||||
WPA_DAEMON_CMD="/usr/sbin/wpa_supplicant -Dwired -ingeth0 -B -C /var/run/wpa_supplicant"
|
||||
|
||||
# kill any existing wpa_supplicant process
|
||||
PID=$(pgrep -f "wpa_supplicant.*ngeth0")
|
||||
if [ ${PID} > 0 ];
|
||||
then
|
||||
/usr/bin/logger -st "pfatt" "terminating existing wpa_supplicant on PID ${PID}..."
|
||||
RES=$(kill ${PID})
|
||||
fi
|
||||
|
||||
# start wpa_supplicant daemon
|
||||
RES=$(${WPA_DAEMON_CMD})
|
||||
PID=$(pgrep -f "wpa_supplicant.*ngeth0")
|
||||
/usr/bin/logger -st "pfatt" "wpa_supplicant running on PID ${PID}..."
|
||||
|
||||
# Set WPA configuration parameters.
|
||||
/usr/bin/logger -st "pfatt" "setting wpa_supplicant network configuration..."
|
||||
IFS=","
|
||||
for STR in ${WPA_PARAMS};
|
||||
do
|
||||
STR="$(echo -e "${STR}" | sed -e 's/^[[:space:]]*//')"
|
||||
RES=$(eval wpa_cli ${STR})
|
||||
done
|
||||
|
||||
# wait until wpa_cli has authenticated.
|
||||
WPA_STATUS_CMD="wpa_cli status | grep 'suppPortStatus' | cut -d= -f2"
|
||||
IP_STATUS_CMD="ifconfig ngeth0 | grep 'inet\ ' | cut -d' ' -f2"
|
||||
|
||||
/usr/bin/logger -st "pfatt" "waiting EAP for authorization..."
|
||||
|
||||
# TODO: blocking for bootup
|
||||
while true;
|
||||
do
|
||||
WPA_STATUS=$(eval ${WPA_STATUS_CMD})
|
||||
if [ X${WPA_STATUS} = X"Authorized" ];
|
||||
then
|
||||
/usr/bin/logger -st "pfatt" "EAP authorization completed..."
|
||||
|
||||
IP_STATUS=$(eval ${IP_STATUS_CMD})
|
||||
|
||||
if [ -z ${IP_STATUS} ] || [ ${IP_STATUS} = "0.0.0.0" ];
|
||||
then
|
||||
/usr/bin/logger -st "pfatt" "no IP address assigned, force restarting DHCP..."
|
||||
RES=$(eval /etc/rc.d/dhclient forcerestart ngeth0)
|
||||
IP_STATUS=$(eval ${IP_STATUS_CMD})
|
||||
fi
|
||||
/usr/bin/logger -st "pfatt" "IP address is ${IP_STATUS}..."
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
/usr/bin/logger -st "pfatt" "ngeth0 should now be available to configure as your WAN..."
|
||||
/usr/bin/logger -st "pfatt" "done!"
|
||||
else
|
||||
/usr/bin/logger -st "pfatt" "error: unknown EAP_MODE. '$EAP_MODE' is not valid. exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
script_path="/root/bin/pfatt-5268AC.sh"
|
||||
script_path="/cf/conf/pfatt/bin/pfatt-5268AC.sh"
|
||||
|
||||
name=`/usr/bin/basename "${script_path}"`
|
||||
|
||||
|
@ -10,14 +10,14 @@ rc_start() {
|
|||
|
||||
${script_path} &
|
||||
pid=$!
|
||||
|
||||
|
||||
if [ $pid ]; then
|
||||
echo $pid > /var/run/${name}.pid
|
||||
/usr/bin/logger -p daemon.info -i -t pfattStartup "Successfully started ${name}"
|
||||
/usr/bin/logger -p daemon.info -i -t pfatt-5268AC "successfully started ${name}"
|
||||
else
|
||||
/usr/bin/logger -p daemon.error -i -t pfattStartup "Error starting ${name}"
|
||||
/usr/bin/logger -p daemon.error -i -t pfatt-5268AC "error starting ${name}"
|
||||
fi
|
||||
|
||||
|
||||
### Remove the lock
|
||||
if [ -f /var/run/${name}.lck ]; then
|
||||
/bin/sleep 2
|
|
@ -1,31 +1,35 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
#
|
||||
# CONFIG
|
||||
# ======
|
||||
#
|
||||
# PING_HOST - IP where ping should check for connectivity
|
||||
#
|
||||
# SLEEP - How often to check connectivity in seconds
|
||||
#
|
||||
|
||||
PING_HOST=8.8.8.8
|
||||
SLEEP=5
|
||||
LOG=/var/log/pfatt.log
|
||||
|
||||
getTimestamp(){
|
||||
echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt-5268AC.sh] ::"`
|
||||
}
|
||||
###############################################################################
|
||||
|
||||
{
|
||||
RG_CONNECTED="/usr/sbin/ngctl show laneapfilter:eapout"
|
||||
RG_CONNECTED="/usr/sbin/ngctl show laneapfilter:eapout"
|
||||
|
||||
echo "$(getTimestamp) Starting 5268AC ping monitor ..."
|
||||
while
|
||||
if /sbin/ping -t2 -q -c1 $PING_HOST > /dev/null ; then
|
||||
if $RG_CONNECTED >/dev/null 2>&1 ; then
|
||||
echo "$(getTimestamp) Connection to $PING_HOST is up, but EAP is being bridged!"
|
||||
echo -n "$(getTimestamp) Disconnecting netgraph node ... "
|
||||
/usr/sbin/ngctl rmhook laneapfilter: eapout && echo "OK!" || echo "ERROR!"
|
||||
fi
|
||||
else
|
||||
if ! $RG_CONNECTED >/dev/null 2>&1 ; then
|
||||
echo "$(getTimestamp) Connection to $PING_HOST is down, but EAP is not being bridged!"
|
||||
echo -n "$(getTimestamp) Connecting netgraph node ... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout && echo "OK!" || echo "ERROR!"
|
||||
fi
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "starting 5268AC ping monitor..."
|
||||
while
|
||||
if /sbin/ping -t2 -q -c1 $PING_HOST > /dev/null ; then
|
||||
if $RG_CONNECTED >/dev/null 2>&1 ; then
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "connection to $PING_HOST is up, but EAP is being bridged!"
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "removing laneapfilter: eapout netgraph hook..."
|
||||
/usr/sbin/ngctl rmhook laneapfilter: eapout
|
||||
fi
|
||||
sleep $SLEEP
|
||||
do :; done
|
||||
echo "$(getTimestamp) Stopping 5268AC ping monitor ..."
|
||||
} >> $LOG
|
||||
else
|
||||
if ! $RG_CONNECTED >/dev/null 2>&1 ; then
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "connection to $PING_HOST is down, but EAP is not being bridged!"
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "connecting waneapfilter: -> laneapfilter: netgraph nodes..."
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
fi
|
||||
fi
|
||||
sleep $SLEEP
|
||||
do :; done
|
||||
/usr/bin/logger -sit "pfatt-5268AC" "stopping 5268AC ping monitor ..."
|
||||
|
|
91
bin/pfatt.sh
91
bin/pfatt.sh
|
@ -1,91 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ONT_IF='xx0'
|
||||
RG_IF='xx1'
|
||||
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
|
||||
LOG=/var/log/pfatt.log
|
||||
|
||||
getTimestamp(){
|
||||
echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt.sh] ::"`
|
||||
}
|
||||
|
||||
{
|
||||
echo "$(getTimestamp) pfSense + AT&T U-verse Residential Gateway for true bridge mode"
|
||||
echo "$(getTimestamp) Configuration: "
|
||||
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
||||
echo "$(getTimestamp) RG_IF: $RG_IF"
|
||||
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
||||
|
||||
echo -n "$(getTimestamp) attaching interfaces to ng_ether... "
|
||||
# Only needed for older versions of pfatt. Newer versions handle this automatically.
|
||||
# Eventually this can be remove.
|
||||
/usr/local/bin/php -r "function_exists('pfSense_ngctl_attach') && pfSense_ngctl_attach('.', '$ONT_IF');"
|
||||
/usr/local/bin/php -r "function_exists('pfSense_ngctl_attach') && pfSense_ngctl_attach('.', '$RG_IF');"
|
||||
echo "OK!"
|
||||
|
||||
echo "$(getTimestamp) building netgraph nodes..."
|
||||
|
||||
echo -n "$(getTimestamp) creating ng_one2many... "
|
||||
/usr/sbin/ngctl mkpeer $ONT_IF: one2many lower one
|
||||
/usr/sbin/ngctl name $ONT_IF:lower o2m
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) creating vlan node and interface... "
|
||||
/usr/sbin/ngctl mkpeer o2m: vlan many0 downstream
|
||||
/usr/sbin/ngctl name o2m:many0 vlan0
|
||||
/usr/sbin/ngctl mkpeer vlan0: eiface vlan0 ether
|
||||
|
||||
/usr/sbin/ngctl msg vlan0: 'addfilter { vlan=0 hook="vlan0" }'
|
||||
/usr/sbin/ngctl msg ngeth0: set $RG_ETHER_ADDR
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $ONT_IF (ONT)... "
|
||||
/usr/sbin/ngctl mkpeer o2m: etf many1 downstream
|
||||
/usr/sbin/ngctl name o2m:many1 waneapfilter
|
||||
/usr/sbin/ngctl connect waneapfilter: $ONT_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining etf for $RG_IF (RG)... "
|
||||
/usr/sbin/ngctl mkpeer $RG_IF: etf lower downstream
|
||||
/usr/sbin/ngctl name $RG_IF:lower laneapfilter
|
||||
/usr/sbin/ngctl connect laneapfilter: $RG_IF: nomatch upper
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) bridging etf for $ONT_IF <-> $RG_IF... "
|
||||
/usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) defining filters for EAP traffic... "
|
||||
/usr/sbin/ngctl msg waneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
/usr/sbin/ngctl msg laneapfilter: 'setfilter { matchhook="eapout" ethertype=0x888e }'
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling one2many links... "
|
||||
/usr/sbin/ngctl msg o2m: setconfig "{ xmitAlg=2 failAlg=1 enabledLinks=[ 1 1 ] }"
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) removing waneapfilter:nomatch hook... "
|
||||
/usr/sbin/ngctl rmhook waneapfilter: nomatch
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $RG_IF interface... "
|
||||
/sbin/ifconfig $RG_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling $ONT_IF interface... "
|
||||
/sbin/ifconfig $ONT_IF up
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $RG_IF... "
|
||||
/sbin/ifconfig $RG_IF promisc
|
||||
echo "OK!"
|
||||
|
||||
echo -n "$(getTimestamp) enabling promiscuous mode on $ONT_IF... "
|
||||
# Updated as per https://github.com/MonkWho/pfatt/issues/65
|
||||
/sbin/ifconfig $ONT_IF promisc -vlanhwtag -vlanhwfilter -vlanhwtso
|
||||
echo "OK!"
|
||||
|
||||
echo "$(getTimestamp) ngeth0 should now be available to configure as your pfSense WAN"
|
||||
echo "$(getTimestamp) done!"
|
||||
} >> $LOG
|
BIN
img/Shellcmd.png
BIN
img/Shellcmd.png
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
4
wpa/.gitignore
vendored
Normal file
4
wpa/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
Loading…
Reference in a new issue