Routing incoming ppp0

Routing incoming ppp0 is a netfilter firewall.
Download

Routing incoming ppp0 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • www.wtf.dk
  • Publisher web site:
  • http://www.linuxguruz.com/iptables/scripts/rc.firewall_020.txt

Routing incoming ppp0 Tags


Routing incoming ppp0 Description

Routing incoming ppp0 is a netfilter firewall. Routing incoming ppp0 is a netfilter firewall.Sample:#!/bin/bash# Load required modules insmod ip_tablesinsmod ip_conntrackinsmod iptable_natinsmod ipt_MASQUERADE# Then flush all rulesiptables -Fiptables -t nat -F# In the NAT table (-t nat), Append a rule (-A) after routing# (POSTROUTING) for all packets going out ppp0 (-o ppp0) which says to# MASQUERADE the connection (-j MASQUERADE).#iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE# Below means 'route 192.168.1.x'iptables -t nat -A POSTROUTING -d ! 192.168.1.0/24 -j MASQUERADEiptables -A FORWARD -s 192.168.1.0/24 -j ACCEPTiptables -A FORWARD -d 192.168.1.0/24 -j ACCEPTiptables -A FORWARD -s ! 192.168.1.0/24 -j DROP# Disallow NEW and INVALID incoming or forwarded packets from ppp0.#iptables -A INPUT -i ppp0 -m state --state NEW,INVALID -j DROP#iptables -A FORWARD -i ppp0 -m state --state NEW,INVALID -j DROP# port 113 is evil ;)iptables -A INPUT --protocol udp --source-port 113 -j DROPiptables -A INPUT --protocol udp --destination-port 113 -j DROP# Turn on IP forwardingecho 1 > /proc/sys/net/ipv4/ip_forward#iptables -A INPUT --protocol udp --source-port 113 -j DROP# Route incoming ppp0 at port 80, to 192.168.1.18:80iptables -A PREROUTING -t nat -p tcp -i ppp0 --dport 80 -j DNAT --to 192.168.1.18:80# Route incoming ppp0 at port 21, to 192.168.1.18:21iptables -A PREROUTING -t nat -p tcp -i ppp0 --dport 21 -j DNAT --to 192.168.1.18:21


Routing incoming ppp0 Related Software