LinuxQuestions.org
Visit Jeremy's Blog.
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 09-03-2006, 09:08 PM   #1
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Rep: Reputation: 30
Router without firewall


how do i setup a box to act as a router (forward traffic from eth1 to/from eth0), so far all i have found are things that make a firewall, but my router is already behind a firewall and is on a trusted network, all i want is for it to act as a wifi bridge, i will control wifi access with stuff like WPA so i just want it to route data between two trusted networks, no firewalling at all
 
Old 09-04-2006, 01:29 AM   #2
camh
Member
 
Registered: Feb 2005
Distribution: Slack/Debian
Posts: 163
Blog Entries: 2

Rep: Reputation: 33
iptables will do the trick. Something like:

Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i SRCIF -o DSTIF -j ACCEPT
iptables -A FORWARD -i DSTIF -o SRCIF -m state --state ESTABLISHED,RELATED -j ACCEPT
 
Old 09-04-2006, 05:23 PM   #3
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Original Poster
Rep: Reputation: 30
ok, i tried that and it doesn't work, these are the exact commands i used (i'm on slack, so i used the startup script to do the ip_forward)

Code:
iptables -A FORWARD -i ath0 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ath0 -m state --state ESTABLISHED,RELATED -j ACCEPT
ath0 is my wifi in AP mode, eth0 is my wired connection connected to my router/firewall, ath0 has the ip 192.168.2.1, eth0 has 192.168.1.25, my router/firewall is 192.168.1.1

my laptop is on wifi has the ip 192.168.2.2 with the router set to 192.168.2.1, after doing the ip_forward stuff i can ping 192.168.1.25(eth0) and 192.168.2.1(ath0) but i can't ping 192.168.1.1(router/firewall)

i've been looking into bridging with brctl but so far i have had little success
 
Old 09-04-2006, 06:21 PM   #4
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Original Poster
Rep: Reputation: 30
ok, i got it working with brctl now, i moved the laptop to have an ip of 192.168.1.20 and gave it a router of 192.168.1.1(the real router/firewall)

then i took both ips off my box acting as an ap
Code:
ifconfig ath0 0.0.0.0
ifconfig eth0 0.0.0.0
then i put the wifi in promisic mode
Code:
ifconfig ath0 0.0.0.0 promisc
then i created a bridge containing both interfaces
Code:
brctl addbr br0
brctl addif br0 ath0
brctl addif br0 eth0
brought the bridge up using my old IP
Code:
ifconfig br0 192.168.1.25 up
and added my gateway back to the routing tables
Code:
route add default gw 192.168.1.1

Last edited by edman007; 09-04-2006 at 06:23 PM.
 
Old 09-05-2006, 05:13 PM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Before you tried bridging, did ever execute the recommended:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
?

None of the iptables "FORWARD" commands will do anything if forwarding is not also turned on.
 
  


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
Small Linux Router/firewall behind D-Link Hardware router dleidlein Linux - Networking 6 04-30-2007 05:12 AM
router billion 5102 has firewall and software firewall tests aus9 Linux - Security 6 12-31-2006 10:09 PM
using a router with firewall, local firewall waste? Michael_aust Linux - General 1 03-26-2006 08:02 AM
linux as router/gateway/firewall to dsl-router sjoerdvvu Linux - Networking 2 02-24-2006 10:56 PM
Mandrake Firewall/router networked to US Robotics 8000A router jrzplace Linux - Networking 0 11-17-2003 04:48 PM

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

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