I'm running a machine on FreeBSD 7.2-RELEASE with a custom kernel (for VESA support) that acts as a broadband router / dhcp server / firewall. We've got two ADSL lines, both with static IP addresses.
Our BT address is causing some issues. They've given us 5 IP addresses:
a.b.c.40/29 gw a.b.c.46
However, when the ppp daemon connects, the tun device is given a dynamic IP address & gateway. Incoming packets to the static IP addresses actually get delivered to this dynamic IP address, so a previous solution was to NAT all outbound packets on the tun device to a.b.c.41, essentially giving me a static IP address.
This setup works but it causes issues for things like ftp-proxy which uses the IP address of the tun device for things like the PORT command, so I decided to see if there was a better solution.
Looking at the man pages for ppp.conf, I saw the set ifaddr option, which I duly set to the following:
However, the tun device never receives an IP address, and continuously attempts to reconnect. Looking at /var/log/ppp.log I see the following entry:
So what appears to be happening is that ppp is requesting my allocated static IP address, but BT are ignoring that and sending back a dynamic IP address & gateway. The ppp daemon then sees that this dynamic IP address doesn't belong in the requested subnet and refuses to connect.
For the moment I've use a pretty ugly hack, I've added entries into my /etc/ppp/ppp.linkup & /etc/ppp/ppp.linkdown a method for setting the IP address I want set to the interface:
It's ugly, and it causes errors in /var/log/messages as the ppp daemon can't assign/remove addresses, but again it works, even with ftp-proxy.
So basically I'm stuck with (in my opinion) a pretty ugly solution which will probably make a lot of people cringe, but unfortunately I can't think of another method. Does anyone know of a better option, ie. getting ppp to ignore the IP address returned by the ISP?
Many thanks,
John
Our BT address is causing some issues. They've given us 5 IP addresses:
a.b.c.40/29 gw a.b.c.46
However, when the ppp daemon connects, the tun device is given a dynamic IP address & gateway. Incoming packets to the static IP addresses actually get delivered to this dynamic IP address, so a previous solution was to NAT all outbound packets on the tun device to a.b.c.41, essentially giving me a static IP address.
This setup works but it causes issues for things like ftp-proxy which uses the IP address of the tun device for things like the PORT command, so I decided to see if there was a better solution.
Looking at the man pages for ppp.conf, I saw the set ifaddr option, which I duly set to the following:
Code:
set ifaddr a.b.c.41/29 a.b.c.46 255.255.255.248 a.b.c.41
However, the tun device never receives an IP address, and continuously attempts to reconnect. Looking at /var/log/ppp.log I see the following entry:
Code:
Apr 13 20:26:38 router ppp[16696]: tun0: Phase: x.x.x.x: Unacceptable address!
So what appears to be happening is that ppp is requesting my allocated static IP address, but BT are ignoring that and sending back a dynamic IP address & gateway. The ppp daemon then sees that this dynamic IP address doesn't belong in the requested subnet and refuses to connect.
For the moment I've use a pretty ugly hack, I've added entries into my /etc/ppp/ppp.linkup & /etc/ppp/ppp.linkdown a method for setting the IP address I want set to the interface:
Code:
# /etc/ppp/ppp.linkup
! sh -c "ifconfig tun0 a.b.c.41/29 a.b.c.46 mtu 1492"
# /etc/ppp/ppp.linkdown
! sh -c "ifconfig tun0 delete"
It's ugly, and it causes errors in /var/log/messages as the ppp daemon can't assign/remove addresses, but again it works, even with ftp-proxy.
So basically I'm stuck with (in my opinion) a pretty ugly solution which will probably make a lot of people cringe, but unfortunately I can't think of another method. Does anyone know of a better option, ie. getting ppp to ignore the IP address returned by the ISP?
Many thanks,
John