Hello all,
I've just registered and this is my first post in this forum. Excuse me for using English, I do not want to tease you with my subpar German.

I discovered this community a some years ago and already found a couple of great tips here, so I would like to reciprocate and share a working OpenWRT 19.07.3 configuration for Fonira static IP address.
I'm using my own PC Engines APU2C4 router and asked for a Zyxel VMG4005-B50A DSL modem from Fonira to replace the default Fritzbox.
The modem is connected to eth0 on the APU2. Internet traffic flows on VLAN31 (ask Fonira why), and I also set up a static IP on the untagged interface, so I can reach the modem (192.168.1.1) with browser and SSH. All the following code snippets are from
/etc/config/network
.
Code:
config interface 'modem'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.1.16'
option force_link '0'
The IPv4 WAN interface is a fairly standard stuff. I'm using my own DNS resolver (Unbound+DNSmasq in chain), so peerdns is 0.
ipv6 is a tricky parameter which still puzzles me. If you set it to 0/no, there will be no IPv6 connectivity. If it's auto, you'll end up with a dynamic address and DP. You need to set it to 1/yes for the next section to work.
Code:
config interface 'wan'
option ifname 'eth0.31'
option proto 'pppoe'
option username 'yourusername@fonira.at'
option password 'yourpassword'
option peerdns '0'
option ipv6 'yes'
Below is the IPv6 WAN interface which I could figure out with a lot of trial and error.
This Fritzbox screenshot gave me the idea to try to use the first /64 subnet from the delegated prefix.
What you need to set:
- ifname to '@wan', so it piggybacks the PPPoE link
- ip6prefix to the /60 network address you got from Fonira
- ip6addr to any address you like in CDIR notation in the first /64 subnet, I chose ::1
- and also add a static IPv6 default route pointing to interface wan
Code:
config interface 'wan6'
option ifname '@wan'
option proto 'static'
option ip6addr '2a02:1748:dead:beef::1/64'
list ip6prefix '2a02:1748:dead:beef::/60'
config route6
option target '::/0'
option interface 'wan'
You'll still have 15 /64 subnets for your internal networks which you can set up with the usual ip6assign and ip6hint parameters. Odhcpd will complain in the logs ("A default route is present but there is no public prefix on XXX thus we don't announce a default route!"), but it works.
Example internal interface configuration and how it looks like (I use several VLANs):
Code:
config interface 'dmz'
option ifname 'eth1.6'
option proto 'static'
option ipaddr '172.16.6.1'
option netmask '255.255.255.0'
option ip6hint '6'
option ip6assign '64'
# ip a l eth1.6
7: eth1.6@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 01:da:da:d1:da:da brd ff:ff:ff:ff:ff:ff
inet 172.16.6.1/24 brd 172.16.6.255 scope global eth1.6
valid_lft forever preferred_lft forever
inet6 2a02:1748:dead:be06::1/64 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fd00:11:0:6::1/64 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::678:b8ed:5341:8636/64 scope link
valid_lft forever preferred_lft forever
#
Finally, I put my 'modem', 'wan', and 'wan6' interfaces into the 'wan firewall zone in
/etc/config/firewall
:
Code:
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'modem wan wan6'
Run
/etc/init.d/network restart
to activate the new network configuration.
I hope I could help others. Let me know if you have any questions.