LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-20-2012, 11:16 AM   #1
cod_liver_0il
Member
 
Registered: Apr 2012
Location: India
Distribution: Slackware, FreeBSD
Posts: 48

Rep: Reputation: Disabled
Iptables help


Hi all, i'm using alienbobs firewall (firewall-generator) and I have an internal lan camera (ip-cam) i want to view through browser....the cam doesn't need to access to my external device. I just want access it through a browser, no nat needed.

ppp0 is my external device (net)
wlan0 is my link to my ip-cam
192.168.0.0/24

I just need to be able access it, anyone help?

With alienbobs firewall generator it uses nat for the second device, so wondered if a couple of rules added to the firewall script would do.
 
Old 05-20-2012, 06:19 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
A diagram showing your network configuration/connections would help.
 
Old 05-21-2012, 06:50 AM   #3
cod_liver_0il
Member
 
Registered: Apr 2012
Location: India
Distribution: Slackware, FreeBSD
Posts: 48

Original Poster
Rep: Reputation: Disabled
Richard Cranium, this is a standalone machine with ppp0 being my net connection and wlan0 is my device to connect to my ip-cam.

ppp0 dynamic ip
wlan0 192.168.0.1
ipcam 192.168.0.2

hope that helps, thanks.
 
Old 05-23-2012, 11:43 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,882

Rep: Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988Reputation: 4988
Eric's firewall generator is very good, but I tend to view it as a little bit of overkill for a simple workstation setup.

This is what I use on my workstation.

/etc/rc.d/rc.firewall:
Code:
#!/bin/sh

IPT='/usr/sbin/iptables'
MODPROBE="/sbin/modprobe"

########################################################################
#  Load FTP connection tracking helper modules
#    (needed for proper operation of ftp client connections)

$MODPROBE nf_conntrack 
$MODPROBE nf_conntrack_ftp 


########################################################################
#  Set default policies for packets that get to the end of a chain
#  without matching a rule.

#  DROP packets on reaching end of INPUT, FORWARD and OUTPUT chain
#  (a.k.a "Better safe than sorry" mode)

$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -P OUTPUT DROP

#  These next ones aren't strictly necessary as we're not using these
#  chains, but setting them to a known state is never a bad idea.

$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT

$IPT -t mangle -P PREROUTING ACCEPT
$IPT -t mangle -P INPUT ACCEPT
$IPT -t mangle -P FORWARD ACCEPT
$IPT -t mangle -P OUTPUT ACCEPT
$IPT -t mangle -P POSTROUTING ACCEPT

# $IPT -t raw -P PREROUTING ACCEPT
# $IPT -t raw -P OUTPUT ACCEPT


########################################################################
#  Flush any existing rules and chains
#    

$IPT -F
$IPT -F -t nat
$IPT -F -t mangle
# $IPT -F -t raw

$IPT -X
$IPT -X -t nat
$IPT -X -t mangle
# $IPT -X -t raw

########################################################################

########################################################################
#  Now insert our own ruleset
#    

#  INPUT CHAIN

$IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

$IPT -A INPUT -i lo -j ACCEPT

#  Example of opening up ports to new incoming connections
#  $IPT -A INPUT -p tcp -i eth0 -m multiport --dports 21,22,25,80,443 \
#  --syn -m state --state NEW -j ACCEPT


#  OUTPUT CHAIN

$IPT -A OUTPUT -j ACCEPT

########################################################################
It doesn't block any outgoing connections, only incoming ones but that should be sufficient for a standalone/workstation type of machine.
 
Old 05-23-2012, 11:57 AM   #5
cod_liver_0il
Member
 
Registered: Apr 2012
Location: India
Distribution: Slackware, FreeBSD
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thanks GazL, i will give that a go.
 
Old 05-24-2012, 06:18 PM   #6
pokute
LQ Newbie
 
Registered: May 2012
Posts: 3

Rep: Reputation: Disabled
I can't say 100% for sure without knowing more about your LAN, but I'm guessing you probably have a wireless router and have it set up to prevent machines on your WLAN from talking directly to each other. In other words, you may not be having an iptables issue on your client machine at all.
 
  


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
iptables error in android: iptables-save and iptables-restore not working preetb123 Linux - Mobile 5 04-11-2011 01:56 PM
On what basis CHAIN integer values are generated in IPtables under iptables file? haariseshu Linux - Server 3 11-05-2009 04:25 AM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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