LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2011, 03:39 PM   #1
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Rep: Reputation: 0
Linux router


I am farly new to linux and I am try to set up a linux box for use as a router. The linux box has 2 NICs: eth0, and eth1. I work for a company that has customer computers come in for repair. We are trying to isolate the workbench from the rest of the servers but still ba able to acces the servers and the internet. our network is setup as folows.

we have a static IP from our ISP (not sure what it is) our severs or 10.1.2.x. the new bench I am setting up will be 10.1.9.x

I have the following static IPs set in the linux box

eth0 10.1.2.76
sub 255.255.255.0
gatway 10.1.2.1

eth1 10.1.9.1
sub 255.255.255.0
Gateway 10.1.2.76

any help would be greatly appreciated

Last edited by mleppelman; 04-11-2011 at 03:47 PM.
 
Old 04-11-2011, 03:46 PM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 612

Rep: Reputation: 32
Ok, we might be able to help, but what is the question ?

1.) Setup the ip`s (which you did )
2.) Configure iptables (if you do not know how to do that I can help you)
3.) echo 1 > /proc/sys/net/ipv4/ip_forward
4.) maybe configure your proxy/router

Last edited by saavik; 04-11-2011 at 03:49 PM.
 
1 members found this post helpful.
Old 04-11-2011, 03:53 PM   #3
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
help

I am having troubles getting it to work. I have no idea how to set up iptables. Help would be greatful. also I am unabl to ping either of the IP from a computer set on the bench with IP of 10.1.9.20

Last edited by mleppelman; 04-11-2011 at 03:57 PM.
 
Old 04-11-2011, 03:59 PM   #4
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
I am having troubles getting it to work. I have no idea how to set up iptables. Help would be greatful. also I am unabl to ping either of the IP from a computer set on the bench with IP of 10.1.9.20
 
Old 04-11-2011, 04:02 PM   #5
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
another thing I just relized is when I hook a computer the eth1 I loose conection to the internet.
 
Old 04-11-2011, 04:56 PM   #6
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
If you are not comfortable working with Linux (and even if you are), I would recommended PFSense, or maybe IPCop or Smoothwall. They will allow you to take an older system with multiple Nics and very easily configure what you want to do.

The nice thing about PFSense is it allows multiple WAN links, can do fail over ... IPCop is more a home user setup, but works well, and Smoothwall also works well

PFSense is FreeBSD based, IPCOP and Smoothwall are Linux based.

Any of these can be setup in about 5 - 10 minutes, and are very stable and as secure as you make them.
 
Old 04-11-2011, 05:15 PM   #7
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
I must be pretty stupid. I can't get any one of those programs to install let alone work.
 
Old 04-11-2011, 07:28 PM   #8
ubyt3m3
Member
 
Registered: Apr 2008
Distribution: Slackware64 13.37, Solaris 10, RHEL5/6
Posts: 92

Rep: Reputation: 19
Hi,
What is your Linux distribution that you use at your work place?
Also, your current problem is that you can't communicate between 10.1.9.x and 10.1.2.x?
I'm trying understand your problem...
-gibb
 
Old 04-11-2011, 08:40 PM   #9
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
First off you need to disable your firewall till you have a working setup. Now just to point out your gw should be blank unless your box is pulling IP from another router (ISP info or unless you are cascading routers). Did you enable ipv4_forwarding in /etc/sysctl.conf.

Last edited by jmc1987; 04-11-2011 at 08:42 PM.
 
Old 04-12-2011, 01:20 AM   #10
hks1233
Member
 
Registered: Nov 2010
Posts: 30

Rep: Reputation: 1
Enabling Ip forwarding


echo 1 > /proc/sys/net/ipv4/ip_forward


eth0 10.1.2.76
sub 255.255.255.0
gatway 10.1.2.1

eth1 10.1.9.1
sub 255.255.255.0
Gateway 10.1.2.76

Assuming etho is the interface having net connection


iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A INPUT -j ACCEPT
iptables -A OUTPUT -j ACCEPT
 
Old 04-12-2011, 09:13 AM   #11
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
my distribution is fedora 14. kernel 2.6.35.11-83.fc14

eth0 is the WAN side. eth1 is the LAN side

another problem I am having is I can't ping either IP from the client computer on the bench. Before I installed the iptables package I was able to ping both.
 
Old 04-12-2011, 09:19 AM   #12
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
I am able to ping both IPs again.
now when I have a computer plugged it to eth1 I can't get on the internet.

It seams the system does not know what nic is use to get on the net and what is used for the test bench. I think once this is fixed it should be working.

Last edited by mleppelman; 04-12-2011 at 11:05 AM.
 
Old 04-12-2011, 09:28 AM   #13
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
this is what I have in sysctl.conf

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

not sure if the second is needed or not but that is what is there.
 
Old 04-12-2011, 11:24 AM   #14
mleppelman
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
after making the sugest changes is restarted network services. this is what I got.

service network restart

Shutting down interface eth0: Device state: 3 (disconnected)
[ OK ]
Shutting down interface eth1: Device state: 3 (disconnected)
[ OK ]
Shutting down loopback interface: Error: Device 'lo' not found.
[FAILED]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/4
[ OK ]
Bringing up interface eth1: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/5
[ OK ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists


I under stand the shutting down and bringing up of the connection but I have no idea what the rest means.
 
Old 04-13-2011, 08:13 AM   #15
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
Quote:
Originally Posted by mleppelman View Post
I must be pretty stupid. I can't get any one of those programs to install let alone work.
They aren't programs, they are complete operating systems, specialized distributions of linux (FreeBSD in the case of PFSense). Simply burn the iso to a CD, boot from the CD, and there will be an option to configure and run off the CD or install to hard drive (which you would want to do after testing).
 
  


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
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 03:17 AM
Small Linux Router/firewall behind D-Link Hardware router dleidlein Linux - Networking 6 04-30-2007 06:12 AM
linux as router/gateway/firewall to dsl-router sjoerdvvu Linux - Networking 2 02-24-2006 11:56 PM
Linux Router & Netgear Wireless Router DMaCATO Linux - Wireless Networking 1 04-30-2004 10:16 AM
/etc/resolv.conf configuration when behind a router(not a linux router) rmanocha Linux - Networking 2 04-28-2004 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration