LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 09-30-2006, 06:44 PM   #1
dkz
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
No /proc/net/ip_conntrack folder in Debian Sarge


Hi.
My status = linux newbie

I would like to know how many connection to port 80 and a ftp port. I have used a perlscript that worked on my other Debian box. But on this new one its says: /proc/net/ip_conntrack: No such file or directory.

Why isn't this folder in my new setup?

Used script:
Code:
netstat="/bin/netstat"
grep="/bin/grep"
sed="/bin/sed"
wc="/usr/bin/wc"
cat="/bin/cat"
printf="/usr/bin/printf"
host="/usr/bin/host"
port=$1
filter="$2"
ip="$3"

ip_conntrack=`$cat /proc/net/ip_conntrack | $grep ESTABLISHED`

if [ -n "$port" ]
then
  if [ "$filter" = src ] || [ "$filter" = dst ]
  then
    ip=`$host "$3" | grep "has address" | cut -d" " -f4`
    res=`$printf "$ip_conntrack" | $grep "dport=$port " | $grep "$filter=$ip" | $wc -l | $sed s/" "//g`
  else
    res=`$printf "$ip_conntrack" | grep "dport=$port " | $wc -l | $sed s/" "//g`
  fi
else
  res=`$printf "$ip_conntrack" | $wc -l | $sed s/" "//g`
fi
printf "$res\n$res\n"
 
Old 10-01-2006, 11:20 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
The whole /proc is a virtual filesystem, so it doesn't "really" exist. It's often described as merely a "peek hole into the kernel", so if you don't have ip_conntrack module enabled in iptables (which is a kernel module, in addition to the iptables software you install) you probably don't have that "folder" (btw. Linux doesn't use "folders", it talks about "directories", and in this case it's a virtual directory) at all.

So, make sure you have ip_conntrack module loaded into your kernel. If it's not builtin (as it seems it's not), try
Code:
modprobe ip_conntrack
and re-run your script again.
 
Old 10-01-2006, 12:05 PM   #3
dkz
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by b0uncer
The whole /proc is a virtual filesystem, so it doesn't "really" exist. It's often described as merely a "peek hole into the kernel", so if you don't have ip_conntrack module enabled in iptables (which is a kernel module, in addition to the iptables software you install) you probably don't have that "folder" (btw. Linux doesn't use "folders", it talks about "directories", and in this case it's a virtual directory) at all.

So, make sure you have ip_conntrack module loaded into your kernel. If it's not builtin (as it seems it's not), try
Code:
modprobe ip_conntrack
and re-run your script again.
Thanx for that b0uncer. Shall write directory insted of folder in the future Old habbit from Windows enviroments.

modprobe worked... Once again thank you...
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't view /proc folder in Nautilus! jhecht Linux - Software 2 09-16-2014 09:41 PM
Net-install Debian Sarge HOWTO? Stimz Linux - Newbie 3 08-14-2005 04:25 PM
Cannot connect to wireless net on Debian (sarge) PeaceTank Linux - Wireless Networking 0 12-25-2004 07:23 PM
Debian Sarge net-install RC1 is great! pevelius Debian 9 09-06-2004 06:55 PM
Problems saving to proc folder Dawyea Linux - Newbie 2 05-19-2004 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration