LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-13-2005, 03:56 AM   #1
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Rep: Reputation: 15
Directing Traffic on 2 LAN Cards


My gateway has 2 cards

192.168.1.3 is for my ISP and 172.16.56.201 for my internal LAN

How do i tell my outside traffic to go through 192.168.1.3 and my internal traffic to go through 172.16.56.201

regards

xing
 
Old 08-13-2005, 12:07 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
??? I don't get your question.

Want to use that box as a router?

If that's the case, you don't have to do much. You have to set both network interfaces and add the default route to your ISP.

Enable forwarding and masquerade traffic going to your ISP. Suppose eth1 is the interface to your isp:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
That will do... maybe there is this or that other detail.. but that's the very basic setup.

Oh... to your lan hosts, set your router as their default gateway.
 
Old 08-17-2005, 02:59 AM   #3
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
That is right..

i want to set up a router but i am facing problems with the route command.. i.e to set the routes..

my local lan is 172.16.56.x and i am able to ping the route 172.16.56.129, which connects me to outside world but i am not able to connect beyond 172.16.56.129.

i ran a traceroute for 172.16.1.100 which is beyond 172.16.56.129 and came to know that traceroute is going through eth1 to 192.168.1.1.. now i want that traffic to local Lan should be routed through eth0 (172.16.56.201) and that for ISP should be routed through eth1 (192.168.1.3)
 
  


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
machine has adsl ethernet modem, to make it gateway over lan do i need more lan cards b0nd Linux - Networking 2 10-04-2005 10:19 PM
Monitoring LAN Traffic prov3.6 Linux - Networking 5 09-19-2005 04:53 PM
Need to route traffic through specific nic cards... Thaidog Linux - Networking 4 07-01-2005 07:31 PM
Need help to route traffic properly with 2 eth cards mchan Linux - Networking 1 03-20-2005 07:55 PM
Need help routing traffic on 2 network cards dan6767 Linux - Networking 13 11-19-2004 09:40 AM

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

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