LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-04-2004, 11:25 AM   #1
jerrytw
LQ Newbie
 
Registered: Nov 2004
Posts: 9

Rep: Reputation: 0
Unhappy I want know what IP address via to NAT server


I have Red Hat 9.0 computer act as NAT and DHCP server . It have two network cards. NIC A connect to ADSL that provide Internet function .NIC B connect to Internal HUB and provide other client via NAT server connect to Internet .

I want to know what the ip address is of the client to connected my nat server. The client connect to Internet by NAT server but I can not monitor who IP address connected to Internet . I want to know this client and use traffic control tools to limit bandwidth . so I want know what command can get simple log file of IP address (connect to Internet).


Configuration as below:

Internet -> ADSL modem with Router -> RH 9.0 (act as NAT server, it has two NIC cards , one (140.138.x.x) connect to ADSL modem ,another NIC (192.168.0.1) connect to Client HUB )

Client HUB -> connect to client computer (Client get IP address as 192.168.0.X)

I want to know what IP address via NAT server to Internet .for example:

Computer A (192.168.0.10) connect to http://www.redhat.com

I want on some log files get 192.168.0.10 connect to www.redhat.com,
As soon as computer (192.168.0.10) disconnect this website , the ip address will disappeard on the log file.

thanks a lot !

Last edited by jerrytw; 11-07-2004 at 08:45 PM.
 
Old 11-04-2004, 11:30 AM   #2
ignarus
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
what do you mean with
"I want know what IP address via to NAT server." ?

I haven't got a clue what you could mean with that sentence...
 
Old 11-04-2004, 11:33 AM   #3
ignarus
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
aha, i didn't read the subject of your post. Do you mean you want to know what the ip address is of the box connected to your nat box?
 
Old 11-04-2004, 08:44 PM   #4
jerrytw
LQ Newbie
 
Registered: Nov 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by ignarus
aha, i didn't read the subject of your post. Do you mean you want to know what the ip address is of the box connected to your nat box?

Yes, I want to know what IP address via NAT server .
Thank you offer an opinion. thanks a lot !
 
Old 11-07-2004, 05:38 PM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
So, your setup is like this:

ADSL Line --> Modem --> A [ RH BOX ] B --> Hub --> LAN Hosts

You are presumably sitting at your PC on the LAN? You can presumably see the Internet? You want to know which IP address? The address of NIC A in the RedHat box? The IP address of your local machine?

Also, just a thought: is your "modem" actually a modem, or is it a Router/modem? If so, then you may find that this also has 2 IP addresses! So you could actually have a setup like this:

ADSL Line --> WAN [Router/Modem] NIC --> A [ RH BOX ] B --> Hub --> LAN Hosts

where WAN, NIC, A, B and Host all have separate IP addresses.
 
Old 11-07-2004, 07:04 PM   #6
NetAX
Member
 
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 145

Rep: Reputation: 15
you can look up the IP address of clients connecting to the server by looking at /var/lib/dhcp/dhcpd.leases This will tell you the IP of the client (it will also tell you the hostname if its a windows box). It also tells you which leases are currently active. I don't know if your distribution comes with iptraf but that daemon will let you monitor the amount of traffic that the client is using once you check the dhcpd.leases file.

Good luck!

Last edited by NetAX; 11-07-2004 at 07:06 PM.
 
Old 11-07-2004, 09:28 PM   #7
jerrytw
LQ Newbie
 
Registered: Nov 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Thymox
So, your setup is like this:

ADSL Line --> Modem --> A [ RH BOX ] B --> Hub --> LAN Hosts

You are presumably sitting at your PC on the LAN? You can presumably see the Internet? You want to know which IP address? The address of NIC A in the RedHat box? The IP address of your local machine?

Also, just a thought: is your "modem" actually a modem, or is it a Router/modem? If so, then you may find that this also has 2 IP addresses! So you could actually have a setup like this:

ADSL Line --> WAN [Router/Modem] NIC --> A [ RH BOX ] B --> Hub --> LAN Hosts

where WAN, NIC, A, B and Host all have separate IP addresses.

Thank you provide question.I will add the more detail description .
 
Old 11-08-2004, 04:42 AM   #8
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
Aha! So you want to know the details of your NAT? You want to know which traffic is going to which PC, and which PC is connecting to which site? If so, then I know that you can access the information directly by looking at the "file" /proc/net/ip_conntrack. However, that file is usually a bit of a mess! You may want to find a parser that will interpret the information for you. I am running an IPCop firewall, which does it all nicely for me, but I know there will be standalone parsers around.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get my external IP address from behind a NAT? Moses420ca Linux - Networking 19 04-13-2012 05:32 PM
Problem Configuring Address Restricted Nat cipherscrux Linux - Networking 1 06-22-2006 01:52 AM
blocking mac address and NAT com90185 Linux - Security 6 03-07-2005 06:37 PM
how to use my Ip address if having a NAT router poeta_boy Linux - Networking 5 04-17-2004 06:10 PM
public ip address from behind nat mrtwice Linux - Networking 3 11-20-2003 05:57 PM


All times are GMT -5. The time now is 01:22 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration