LinuxQuestions.org
Visit Jeremy's Blog.
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 12-21-2007, 05:27 PM   #1
glok_twen
LQ Newbie
 
Registered: Jun 2007
Posts: 11

Rep: Reputation: 0
getting linux box to run as a switch and router btwn subnets


hi. i have a linux box with 2 nic's, one wireless and one wired. i have the wireless nic successfully linked to the wireless lan and can browse. i have the wired one connected to a switch and want to let other machines hardwired to that same switch route through the linux box that's wirelessly connected via the first nic to my router. can't get this to work.

right now from linux i can:
- browse externally
- ping the nic on another hardwired node connected to the switch

from the hardwired node i can:
- ping the hardwired nic on the linux box
- ping the wireless nic on the linux box
- BUT i can not ping from all the way through the linux machine to the router. nor can i get external.

can you tell what i mis-configured?

here is netstat -r. wlan0 connects wirelessly to my lan from linux. eth0 is the one hardwired to a switch and then connected to an xp box.

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 0 0 0 wlan0
default 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
 
Old 12-21-2007, 05:53 PM   #2
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
Check out bridging in Linux:

http://www.linux-foundation.org/en/Net:Bridge

Bridging is supported in Linux, but some wireless NIC drivers may not support it.
 
Old 12-21-2007, 06:43 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I once used my laptop to give my desktop wireless access. You are doing the same thing. The only difference is that I subnetted my network into 192.168.0.0 & 192.168.128.0 with a 255.255.128.0 netmask.

The other computers should use the Linux box's NIC IP address as the default gateway.
On the linux box you need to enable ip_forward
As root: echo 1 >/proc/sys/net/ipv4/ip_forward.

On some Linux systems, this is done in a startup script. On others, you can enable ip forwarding in the network setup program.
IIRC, I still needed to modprobe the ip_conntrack kernel module (or was it tcp_conntrack) for forwarding to work. On recent kernels it is called the nf_conntrack module. The description of the module is that it is used for masquerading, which I wasn't doing, but I still needed this module for forwarding to work.

I don't use ipv6 at all and don't know if something else needs to be done in that case.
 
  


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
Two subnets connected through one linux box to the internet site_ml Linux - Networking 8 05-15-2007 04:11 PM
Two subnets connected through one linux box to the internet site_ml Linux - Networking 1 05-13-2007 12:17 PM
Linux box as a router/switch/WLAN brige? veggieboy4000 Linux - Wireless Networking 1 04-10-2007 01:05 AM
I need to setup a Linux router for my 2 public subnets drcoco Linux - Networking 4 05-17-2006 09:36 PM
easy way to switch btwn prism2 drivers? hank43 Linux - Wireless Networking 1 05-23-2004 06:18 AM

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

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