LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-07-2014, 08:08 PM   #1
oreizinho
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Rep: Reputation: Disabled
2 networks in and 1 out


I have two external connections, one is internet (eth1 velox-ip: 192.168.0.10) and the other is a company intranet (eth0 ip: 10.1.240.x) and a local (eth0 in the range 10.1.240.x) I want to put it to work as follows:

one computer with 2 network cards input for velox and intranet, and other output for the company pcs. to work all in one conection.

i used the command route add default gw 192.168.0.10 to leave the internet as the main gw, and put it in rc.local:

echo 1> / proc/sys/net/ipv4/ip_forward
iptables-t nat-A POSTROUTING-o eth1-j MASQUERADE

if internet works,the intranet network doesn't works, and if i put the intranet gw as default, the internet conection doesn't works. how can i put the two conections to works together.
 
Old 07-07-2014, 10:02 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,225

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by oreizinho View Post
I have two external connections, one is internet (eth1 velox-ip: 192.168.0.10) and the other is a company intranet (eth0 ip: 10.1.240.x) and a local (eth0 in the range 10.1.240.x) I want to put it to work as follows:

one computer with 2 network cards input for velox and intranet, and other output for the company pcs. to work all in one conection.
This sounds like two connections. Are there two or three NICs?

Quote:
i used the command route add default gw 192.168.0.10 to leave the internet as the main gw,
You are routing packets to your own eth1 port. That doesn't sound right.
Quote:
and put it in rc.local:

echo 1> / proc/sys/net/ipv4/ip_forward
iptables-t nat-A POSTROUTING-o eth1-j MASQUERADE

if internet works,the intranet network doesn't works, and if i put the intranet gw as default, the internet conection doesn't works. how can i put the two conections to works together.
You are missing spaces in the line you posted. That command would not work.
 
Old 07-07-2014, 10:33 PM   #3
oreizinho
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
There are 3 conections, 2 external(but one has internet and other is an intranet) and 1 local. So i wanna share the two external conections over the lan conection.
 
  


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
/etc/networks solomani Red Hat 4 05-28-2010 02:57 AM
I am bridging 2 networks, but only want the Bridge machine to see both networks. themrrobert Linux - Networking 1 02-17-2009 01:40 PM
networks and IP's wi77ard Linux - Networking 2 02-15-2004 07:26 PM
Use two networks? trees Linux - Networking 7 12-24-2003 12:01 PM
new to networks!!! bigjohn Linux - Networking 0 01-28-2003 03:48 PM

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

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