LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-22-2006, 08:35 AM   #1
rdr129
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
problem with command "modprobe iptables" in the debian server


Hi! I want to make a home network. I have an old pentium 200 with 64 Mb Ram and 4 Giga of hard disk with two realtek network cards with an old version of debian in text form with only the essentials installed in it. Beside it I have three other computers (with os windows installed)linked to the debian server with a cheap and simple switch. Below is listed all files that I configured :

1)
/etc/network/interfaces:
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.1
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255

2)
/etc/gateway.rules:

/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
/sbin/iptables -X

/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
/sbin/iptables -P INPUT DROP

/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

/sbin/iptables -A FORWARD -i eth0 -o eth0 -j REJECT

3)
/etc/init.d/gateway :

#! /bin/sh

# If no rules, do nothing.
[ -f /etc/gateway.rules ] || exit 0

case "$1" in
start)
echo -n "Turning on packet filtering:"
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_MASQUERADE
/sbin/ipchains-restore < /etc/ipchains.rules || exit 1

echo 1 > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr


echo "."
;;
stop)
echo -n "Turning off packet filtering:"
echo 0 > /proc/sys/net/ipv4/ip_forward

/sbin/ipchains -F
/sbin/ipchains -X
/sbin/ipchains -P input ACCEPT
/sbin/ipchains -P output ACCEPT
/sbin/ipchains -P forward ACCEPT
echo "."
;;
*)
echo "Usage: /etc/init.d/gateway {start|stop}"
exit 1
;;
esac

exit 0

3)
I connected my server to my adsl provider using 'pppoeconf' (in /usr/sbin)

# cd /usr/sbin
# pppoeconf

and finally I was able to browse with my server (text form as I don't have the graphics installed - using ping command ).

4)
I did the usual configurations with the internal computers (with os windows)providing them with the static IP and primary and secondary DNS Server as given by my ISP.

I conclude this long and boring letter indicating the problems that I am having :


a)my internal computers are not able to see my server
b)using command at my sever console like:

bash# modprobe ip_tables
bash# lsmod | grep ip_tables

gives me error like modprobe iptables not found!!!!
c)using make menuconfig the computer says that they are commands not defined.


I thank you for reading it all and I hope that somebody will be able to resolve my problems.

Last edited by peter_robb; 04-22-2006 at 09:51 AM.
 
Old 04-22-2006, 09:49 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
In your /etc/init.d/gateway file you make quite a few references to /sbin/ipchains.. They should be iptables.. Especially when loading the ruleset..

Start with ifconfig to see which interfaces you have..
Then dmesg to see which interface was given to the pppoe connection..
Then do route -n to see which gateway is used..
Then do iptables-save to list the currently loaded iptables rules..
and lsmod to show the currently loaded modules..

Then adjust your rules to use the interface the gateway is on as the outgoing interface.
You don't generally need to manually load iptables/netfilter modules as they load when the rule is loaded. Some do need manual loading, eg ftp and irc modules.

One rule states FORWARD -i eth0 -o eth0 -j REJECT which does nothing..
The FORWARD rules do nothing useful as the POLICY is ACCEPT anyway and no rules DROP anything..

I'd suggest a read of the iptables tutorial..

Last edited by peter_robb; 04-22-2006 at 10:08 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Boot Up Problem - stuck at "BR" & "I" jc70417 Debian 2 08-30-2005 05:36 PM
"stalled" problem in " scp" command gentleshark Linux - Networking 1 08-29-2005 01:41 PM
Gumstix usbnet problems..."modprobe" command unrecognised triona Linux - General 3 11-04-2004 11:09 AM
My system freezes after I issue the "modprobe ndiswrapper" command. markjc Linux - Wireless Networking 1 08-24-2004 10:47 AM
"modprobe usbkbd" command cann't be executed! lucklemon Linux - Hardware 1 05-21-2004 09:43 AM

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

All times are GMT -5. The time now is 07:10 PM.

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