Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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:
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.
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 !
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.
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 145
Rep:
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.
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 .
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.