LinuxQuestions.org
Help answer threads with 0 replies.
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 11-14-2005, 04:29 PM   #1
trawler
Member
 
Registered: Oct 2005
Distribution: Ubuntu 5.10
Posts: 50

Rep: Reputation: 15
Streaming - possible iptables problem


Even since i switched off my selinux firewall and used an iptables script to enhance security, i can't play streaming audio (online radio) through my mplayer-plugin.

It could be a plugin problem, but my gut tells me something is blocking the audio stream.
I'm not sure what i need to open up to allow connections in (which port, if any), but i would appreciate it if you could take a look at this script:
Code:
#!/bin/bash
## Edit the line below to define your ethernet interface
## It is usually eth0
ETH=eth0

## Edit the line below to indicate where your iptables
## binary exists.  It is usually /sbin/iptables.
IPT=/sbin/iptables

## Check to see if the ip_tables module has been loaded.
## If not, load the module.

##/sbin/lsmod 2>/dev/null |grep -q iptables
##if [ $? -ne 0 ]; then
##        echo "Adding iptables module"
##        /sbin/insmod iptables
##	/sbin/modprobe ip_conntrack_ftp
##fi

## First, we set a number of network stack parameters to protect
## against various network-based attacks.

## Try to prevent SYN floods
echo "1" > /proc/sys/net/ipv4/tcp_syncookies

## Disable response to ICMP broadcasts.
/bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts 

## Reject source-routed packets.
/bin/echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route 

## Disable ICMP redirect acceptance.
/bin/echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects 

## Enable bad error message protection
/bin/echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses 

## Enable reverse path filtering.
/bin/echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter

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

## Disable IP forwarding.
/bin/echo "0" > /proc/sys/net/ipv4/ip_forward 

## Now we start using iptables...

## Flush chains, clear existing chains, zero counters
$IPT -F 
$IPT -X 
$IPT -Z 

## Default policies
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP

## Drop all incoming fragments 
$IPT -A INPUT -i $ETH -f -j DROP

## Drop outside packets with localhost address - anti-spoofing measure
$IPT -A INPUT -s 127.0.0.0/255.0.0.0 -i \! lo -j DROP

## Pass all locally-originating packets
$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT

## Accept ICMP ping (8) packets (this allows other people to ping your machine).
#$IPT -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

## Accept all traffic from a specific machine with IP x.x.x.x
## replace x.x.x.x with the desired IP
$IPT -A INPUT -i $ETH -s x.x.x.x -j ACCEPT

## Accept ssh traffic from a specific machine with IP x.x.x.x
## replace x.x.x.x with the desired IP
$IPT -A INPUT -p tcp --syn -i $ETH -s x.x.x.x --dport 22 -j ACCEPT

## Accept all inbound ssh traffic
#$IPT -A INPUT -p tcp --syn -i $ETH -s 0/0 --dport 22 -j ACCEPT

## Accept all inbound identd
#$IPT -A INPUT -p tcp --syn -i $ETH -s 0/0 --dport 113 -j ACCEPT
## or you can reject and send back a TCP RST packet instead
#$IPT -A INPUT -p tcp -i $ETH -s 0/0 --dport 113 -j REJECT --reject-with tcp-reset

## Allow all sendmail SMTP traffic
#$IPT -A INPUT -p tcp --syn -i $ETH -s 0/0 --dport 25 -j ACCEPT
## Allow all sendmail MSA traffic
#$IPT -A INPUT -p tcp --syn -i $ETH -s 0/0 --dport 587 -j ACCEPT

## Allow all web server access (port 80)
#$IPT -A INPUT -p tcp --syn -s 0/0 --dport 80 -j ACCEPT
## Allow all secure web server access (port 443)
#$IPT -A INPUT -p tcp --syn -s 0/0 --dport 443 -j ACCEPT
#$IPT -A INPUT -p tcp --syn -s 0/0 --dport 3306 -j ACCEPT
#$IPT -A INPUT -p icmp -s 0/0 -j ACCEPT

## Allow inbound established and related outside communication 
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -i $ETH -j ACCEPT

## Drop outside initiated connections
#$IPT -A INPUT -m state --state NEW -i $ETH -j DROP

## Allow all outbound tcp, udp, icmp traffic with state
$IPT -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT 
$IPT -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
Any help would be appreciated
 
  


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
Darwin Streaming Server problem tendonut Linux - Software 0 11-11-2005 12:37 PM
Darwin Streaming Server Connection problem mting923 Linux - Newbie 0 11-09-2005 12:47 PM
C++ console streaming problem baldurkn Programming 1 08-23-2004 09:29 PM
Problem with Mplayer streaming darkman7t5 Linux - Newbie 1 05-02-2004 03:02 AM
Audio streaming problem in Mandrake 9.2 Alex99 Linux - Newbie 2 12-17-2003 05:32 PM

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

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