[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange output from ifconfig tun0
> On Fri, Dec 29, 2000 at 08:43:01AM -0500, Richard J Kuhns wrote:
> > Martin Maciaszek writes:
> > > I wanted to know my ip address assigned from my isp. here's what
> > > happened:
> > >=20
> > > root@renraku:~# ifconfig tun0
> > > tun0: flags=3D11<UP,POINTOPOINT> mtu 1524
> > > inet 10.0.0.1 --> 10.0.0.2 netmask 0xffffffff=20
> > > inet 194.29.57.188 --> 255.255.255.255 netmask 0xffffffff=20
> > ...
> > > inet 194.29.58.192 --> 255.255.255.255 netmask 0xffffffff=20
> > > inet 194.29.59.7 --> 255.255.255.255 netmask 0xffffffff=20
> > > inet 194.29.57.197 --> 195.211.161.132 netmask 0xffffffff=20
> > >=20
> > > These are obiously all my ip addresses assigned to me from my isp
> > > (since I started ppp(8)). Is this normal?
> > >=20
> >=20
> > Try adding=20
> >=20
> > label:
> > iface clear
> >=20
> > to /etc/ppp/ppp.linkdown, where `label' is the label you used when you
> > started ppp.
> >=20
> This solved the problem partially. I added the line to the MYADDR
> section. Now I still habe multiple addresse assigned to my tun0
> interface. After hanging up tun0 keeps its last ip address. When
> I dial out again tun0 has two ip addresses assigned. After
> hanging up the last address is kept. Is there some way to have
> only one address assinged after dailing up? This would also solve
> the snmp-problem.
With ``iface clear'' in ppp.linkdown, ppp leaves two IP addresses
on the interface so that the process that causes ppp to dial ends
up bound to a valid IP number. Without this, that initial
connection will fail.
When the link is closed, you have (say) IP 10.0.0.1. You run ``ftp
somehost''. ftp binds to address 10.0.0.1 and sends the first packet
out. This causes ppp to establish a connection and get a new IP
number from the peer. In order to maintain that ftp connection, ppp
keeps the new IP number as the primary IP number and the old
(10.0.0.1) number as an alias. The initial packet gets NATd so that
the source IP number is changed to the the new IP number on the way
out and is changed back to 10.0.0.1 for return traffic.
If you don't want ppp to do this (and have your first connection
fail), add ``disable iface-alias'' to your config.
> Cheers
> Martin
--
Brian <brian@Awfulhak.org> <brian@[uk.]FreeBSD.org>
<http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !