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 02-23-2005, 09:25 AM   #1
Ossar
Member
 
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 38

Rep: Reputation: 15
/proc/ ip forwarding etc


Running Debian sarge kernel 2.6.8. I'm using my linux box as a router for the rest of my network. I want to use NAT and forward ports to different clients.

I have a script I got from a friend. It succesfully opens/closes ports on the router itself but it won't forward anything.

This is a part of my script.

# Enable response to ping.
$ECHO "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all

# Disable response to broadcasts (smurf attack).
$ECHO "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

# Don't accept source routed packets (rarely used for legit purposes).
$ECHO "0" > /proc/sys/net/ipv4/conf/all/accept_source_route

# Disable ICMP redirect acceptance (can alter routing tables).
for interface in /proc/sys/net/ipv4/conf/*/accept_redirects; do
$ECHO "0" > ${interface}
done

# Enable bad error message protection.
$ECHO "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses

# Turn on reverse path filtering (ip spoofing).
for interface in /proc/sys/net/ipv4/conf/*/rp_filter; do
$ECHO "1" > ${interface}
done

# Log spoofed packets, source routed packets, redirect packets.
$ECHO "1" > /proc/sys/net/ipv4/conf/all/log_martians

# Make sure that IP forwarding is turned off. We only want this for a multi-homed host.
$ECHO "0" > /proc/sys/net/ipv4/ip_forward




All these files don't exist. What did I miss? Probably something in the kernel.
 
Old 02-23-2005, 03:44 PM   #2
bagira
LQ Newbie
 
Registered: Dec 2003
Location: Germany
Distribution: Gentoo
Posts: 27

Rep: Reputation: 15
Ossar,
as I understand you right, you want to forward some connections to a internal server like to forward everthing arriving on port 80 at your router to an internal webserver ?!? The settings you posted are responsible for the router itself, if it forwards broadcasts and pings ... . To do NAT, you have to install iptables (www.netfilter.og). This allows you to NAT and forward connections. You also have to compile your kernel with this settings.
Would be helpful to give us more information what you want o forward/NAT (ports, connections ..)!
Cheers
bagira
 
Old 02-24-2005, 11:21 AM   #3
Ossar
Member
 
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 38

Original Poster
Rep: Reputation: 15
No you got me all wong. I have iptables and a working script. Its just that dont have the /proc/sys folder at all. I have compiled sysfs into the kernel but to no avail.
 
Old 02-24-2005, 11:34 AM   #4
BinaryBob
Member
 
Registered: Aug 2002
Posts: 117

Rep: Reputation: 15
Sounds like the kernel does'nt have the options compiled in. Make sure both CONFIG_PROC, CONFIG_SYSCTL are enabled, and built directly into the kernel.
 
Old 02-24-2005, 11:58 AM   #5
Ossar
Member
 
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 38

Original Poster
Rep: Reputation: 15
Yes they are!

I have /proc with different stuff in it but not /proc/sys

EDIT: oops, I don't have SYSCTL. Thought of SYSFS

Last edited by Ossar; 02-24-2005 at 12:00 PM.
 
  


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
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 12:10 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Correlation between /proc/devices and /proc/modules ColinLadyka Linux - General 1 02-13-2006 05:25 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
What /proc proc file do I need? GoboFraggle Programming 1 02-04-2003 11:52 PM

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

All times are GMT -5. The time now is 05:15 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