LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-26-2008, 02:10 AM   #1
matsyuf
Member
 
Registered: Mar 2007
Posts: 97

Rep: Reputation: 15
Re: Proxy


Hello all,

I am newbie and trying to learn how to make a Proxy- I made my script through a tutorial and later put it in /etc/init.d/ so that it could boot on system start, unfortunately when i connected a COmputer onto the internal interface , I wouldnt ping the internal ip neither would i browse anything, Am asking where I may have went wrong, below is my script:-

YM:~# cat Firewall.sh
#!/bin/sh

echo -e \n\nLoading YUSUF firewall..\n

IPTABLES=/sbin/iptables
DEPMOD=/sbin/depmode
MODPROBE=/sbin/modprobe
INTIF=eth1
EXTIF=eth0
echo External Interface: $EXTIF
echo Internal Interface: $INTIF
echo Enabling forwarding..
echo 1 > /proc/sys/net/ipv4/ip_forward
echo Enabling DynamicAddr..
echo 1 >/proc/sys/net/ipv4/ip_dynaddr
echo Clearing any existing rules and setting default poilcy..
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo FWD: Allow all connections OUT and only existing and related ones IN
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo -e "\YUSUF firewall\n"
YM:~#

and when execute it

YM:~# /etc/init.d/Firewall.sh
nnLoading YUSUF firewall..n
External Interface: eth0
Internal Interface: eth1
Enabling forwarding..
Enabling DynamicAddr..
Clearing any existing rules and setting default poilcy..
FWD: Allow all connections OUT and only existing and related ones IN
\YUSUF firewall

YM:~#

but nothing it working for me yeThe external interface is to my DHCP Lan network.

Regards
 
Old 02-26-2008, 04:26 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by matsyuf View Post
I am newbie and trying to learn how to make a Proxy- I made my script through a tutorial and later put it in /etc/init.d/ so that it could boot on system start, unfortunately when i connected a COmputer onto the internal interface , I wouldnt ping the internal ip neither would i browse anything, Am asking where I may have went wrong, below is my script:-

YM:~# cat Firewall.sh
#!/bin/sh

echo -e \n\nLoading YUSUF firewall..\n

IPTABLES=/sbin/iptables
DEPMOD=/sbin/depmode
MODPROBE=/sbin/modprobe
INTIF=eth1
EXTIF=eth0
echo External Interface: $EXTIF
echo Internal Interface: $INTIF
echo Enabling forwarding..
echo 1 > /proc/sys/net/ipv4/ip_forward
echo Enabling DynamicAddr..
echo 1 >/proc/sys/net/ipv4/ip_dynaddr
echo Clearing any existing rules and setting default poilcy..
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo FWD: Allow all connections OUT and only existing and related ones IN
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo -e "\YUSUF firewall\n"
YM:~#

and when execute it

YM:~# /etc/init.d/Firewall.sh
nnLoading YUSUF firewall..n
External Interface: eth0
Internal Interface: eth1
Enabling forwarding..
Enabling DynamicAddr..
Clearing any existing rules and setting default poilcy..
FWD: Allow all connections OUT and only existing and related ones IN
\YUSUF firewall

YM:~#

but nothing it working for me yeThe external interface is to my DHCP Lan network.
None of what you posted would create a proxy. It looks like you're trying to make a NAT router instead. This means your LAN boxes will need to be configured to use the LAN IP of the router as their default gateway. BTW, I'm moving this to Networking, as it's not a security question.

Last edited by win32sux; 02-26-2008 at 04:28 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
configure squid proxy with cc proxy as a parent proxy faisi Linux - Networking 1 08-10-2010 01:16 PM
squid proxy server configuration & distribution of internet without proxy gaurav_gupta082 Linux From Scratch 2 07-31-2010 11:25 AM
configure squid proxy with microsoft proxy as a parent proxy nintykola Linux - Software 1 08-28-2007 01:38 AM
if proxy A stop working then how users are shifted automatically on the other proxy B shahg_shahg Linux - Networking 1 01-10-2007 07:42 AM

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

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