Getting public IP address of NAT firewall

Rasjid Wilcox rasjidw at
Sun Feb 10 15:15:50 EST 2002

On Thu, 7 Feb 2002 11:28 pm, Rasjid Wilcox wrote:
> Suppose that I have a hardware fireall that does NAT and it is given a
> dynamic IP address by the ISP.  Is there any way for a user of a
> workstation behind the firewall to find out the public IP address of the
> firewall without logging into the firewall?
> What I'm thinking is, is there any information kept in the TCP/IP headers
> that would allow me to do this, or is that all lost during the NAT/IP
> masquarade process?
> Rasjid.

The following seems to do what I want.

$ ping -c 1 -R | grep -C1 "RR:" | tail -n1 (

Thanks to all who replied.


PS.  I'm sure there is a better way of saying 'the line after the one where 
"RR:" appears', but it works.

More information about the linux mailing list