LinuxQuestions.org
Review your favorite Linux distribution.
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 07-15-2012, 09:37 PM   #1
bangst
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Emulating "routing mode" on Linksys router


Hello all. First post here.

For quite awhile I have been using an old Linksys WRT54G2 router. I use DHCP to my ISP and get back a static public IP (69.69.169.95). My ISP also gives me an 8 IP subnet (167.70.99.80/29) which routes through the static address. I am able to use this subnet of public IPs because my WRT54G2 has a "router mode" (as opposed to just NAT'ing in gateway mode.)

I've set the LAN-side IP of the Linksys router to 167.70.99.81. Here is the route table as it appears on the WRT54G2 router. (I don't add the entries, they just "magically" appear when I get the static address from my ISP):


Code:
Dest LAN IP     Subnet Mask      Gateway       IF
0.0.0.0         0.0.0.0          69.69.169.1   WAN
69.69.169.0     255.255.255.0    69.69.169.95  WAN
167.70.99.80    255.255.255.248  167.70.99.81  LAN


This works great for my home devices which are all behind a Linux box NAT'ing and firewalling on one of the public IPs in the 167 subnet as well as any other systems to which I assign a static 167.70.99.x address (in what I suppose would qualify as a DMZ.)

I am now trying to replace that router with a Linux box but I'm really struggling getting the route table right. For the new Linux system I'm using a minimal install of CentOS 6.3. on a box with four NICs. One for WAN (eth3), one for DMZ (eth1) where I'll put my 167.70.99.x servers and a couple extra unused NICs at this time. I think I need a router IP address like the Linksys so I've set eth1 to 167.70.99.81 and manually added a route entry like this:


Code:
route add -net 167.70.99.80/29 gw 167.70.99.81


I suspect this isn't the right thing to do since when I hook up to the ISP my route table looks like this:


Code:
Dest LAN IP     Gateway          Genmask      	  Flags IF
167.70.99.80    167-70-99-81.ip  255.255.255.248  UG   	eth1
167.70.99.80    *		 255.255.255.248  U     eth1
69.69.169.0     *                255.255.255.0    U     eth3
default         69.69.169.1      0.0.0.0          UG    eth3


Devices on 167.70.99.x don't get out. What do those dashes and the ".ip" mean on the eth1 entry? How do I get the Linux box to emulate to Linksys router by routing to the subnet? What should the eth1 configuration look like?

Thanks for any suggestions.
 
Old 07-15-2012, 09:53 PM   #2
bangst
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
OK, it's working now. Isn't that the way things work? You bang your head against the wall for hours and when you finally break down and decide to ask the Internet, ten minutes later it starts working? I guess I'll leave the post up, maybe it will help someone. Turns out I just had to enable IP forwarding in /etc/sysctl.conf:

net.ipv4.ip_forward = 1

That, and stop iptables which I'll configure later.
 
  


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
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Error for wireless request "Set Mode" on Linksys WPC11 v 3 army180 Linux - Wireless Networking 2 09-04-2006 06:32 PM
linksys router "freezing" pfunk Linux - Networking 0 10-19-2004 01:10 PM
"Could not set monitor mode" in AirSnort on LinkSys WPC11 v2 WolfBLN Linux - Wireless Networking 0 04-30-2004 05:14 AM

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

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