LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 11-10-2007, 02:32 PM   #1
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Slackware 11 as home router


I wan't to use my server as a router for me to connect to the internet when I'm at the servers location with my laptop. I don't want to mess anything up so I would like some help with it as it is a long time since I configured a router and that was on a BSD, never on Linux before.
So far two ethernet cards are installed in the system, et0 and eth0. The server connects to the internet with a PPPoE connection.
This is my current firewall(iptables) settings:
Code:
# Generated by iptables-save v1.3.5 on Sun May  6 19:37:56 2007
*filter
:INPUT ACCEPT [18676850:1350698484]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [20116489:2046243565]
-A INPUT -i tun0 -p udp -m udp --dport 445 -j ACCEPT
-A INPUT -i tun0 -p tcp -m tcp --dport 445 -j ACCEPT
-A INPUT -i tun0 -p tcp -m tcp --dport 137:139 -j ACCEPT
-A INPUT -i tun0 -p udp -m udp --dport 137:139 -j ACCEPT
-A INPUT -i tun+ -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 1194 -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 143 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 113 -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 113 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 0:1023 -j LOG
-A INPUT -i ppp0 -p tcp -m tcp --dport 0:1023 -j LOG
-A INPUT -i ppp0 -p udp -m udp --dport 0:1023 -j DROP
-A INPUT -i ppp0 -p tcp -m tcp --dport 0:1023 -j DROP
-A INPUT -i ppp0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j LOG
-A INPUT -i ppp0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
COMMIT
# Completed on Sun May  6 19:37:56 2007
ppp0 is the interface from pppoe connection and tun0 is the interface for OpenVPN.

I was thinking of configuring it like this:
Code:
*nat
:PREROUTING ACCEPT [127:7628]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [1:172]
-A PREROUTING -d 10.0.0.100 -p tcp -m tcp --dport 6881 -j DNAT
--to-destination 10.0.0.100:6881
-A POSTROUTING -s 10.0.0.100 -p tcp -m tcp --sport 6881 -j SNAT
--to-source 10.0.0.100:6881
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [300:34294]
:INPUT - [0:0]
-A INPUT -j INPUT
-A FORWARD -j INPUT
-A FORWARD -i eth1 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A FORWARD -i eth1 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A INPUT -p esp -j ACCEPT
-A INPUT -p ah -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p ipv6-crypt -j ACCEPT
-A INPUT -p ipv6-auth -j ACCEPT
# And all other ports to accept
-A INPUT -i ppp0 -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 113 -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 113 -j ACCEPT
-A INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
Where 10.0.0.100 would be my laptops IP. Would this work ok?

Also how would I then configure my Slackware 12 laptop. Because at home I use a WLAN connection to a router and then to the internet. And I would like my laptop to check eth0 if a cable is present it uses eth0 for the connection and if not it would use wlan0 interface to connect via WLAN.
 
Old 11-11-2007, 07:09 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I had to make my computer into a router recently, and this is how I did it:
http://www.linuxquestions.org/questi...4/#post2908609

I hope it helps some.
 
  


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
proftpd behind the home router gesho Linux - Server 5 09-23-2007 09:13 PM
BT Home Hub Router ffilc7373 Ubuntu 5 11-14-2006 02:59 PM
Best distro for home router tadziu23 Linux - Networking 7 11-15-2005 08:14 AM
want to ssh/ftp to home machine (Slack) from office through home router fincher69 Linux - Networking 2 09-21-2005 10:55 PM
@home with hardware router drisay Linux - Networking 4 12-08-2004 11:55 AM

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

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