LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 08-28-2011, 11:52 PM   #1
famsinyi
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Rep: Reputation: 0
linux router


I have three pcs. They are referred as:

pcA:
NIC 192.168.1.2,
subnet mask: 255.255.255.0
default gateway 192.168.1.1

pcB:
NIC 192.168.2.2,
subnet mask: 255.255.255.0
default gateway 192.168.2.1

pcRouter: two NICs:
eth0 192.168.1.1, subnet mask: 255.255.255.0
eth1 192.168.2.1, subnet mask: 255.255.255.0
this command is executed:
echo 1 > /proc/sys/net/ipv4/ip_forward

when I ping from pcA:
ping 192.168.2.2

ping returned:
From 192.168.1.1 icmp_seq=1 destination Host Prohibited
 
Old 08-29-2011, 01:35 AM   #2
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Ubuntu
Posts: 199

Rep: Reputation: 36
Have you set your IP tables rules to route the packets?
 
Old 08-29-2011, 05:33 AM   #3
allwimb
Member
 
Registered: Aug 2011
Posts: 47

Rep: Reputation: Disabled
one of the easiest way to do it is NAT:
iptables -t nat -A POSTROUTING -i eth0 -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -i eth1 -o eth0 -j MASQUERADE

that should work correctely

spring logout

Last edited by allwimb; 12-12-2011 at 05:50 AM.
 
  


Reply

Tags
routers


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Linux box as IPv6 router to replace Netgear WNR1000 wireless router samcan Linux - Networking 1 06-19-2011 05:30 AM
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 02:17 AM
Small Linux Router/firewall behind D-Link Hardware router dleidlein Linux - Networking 6 04-30-2007 05:12 AM
linux as router/gateway/firewall to dsl-router sjoerdvvu Linux - Networking 2 02-24-2006 10:56 PM
Linux Router & Netgear Wireless Router DMaCATO Linux - Wireless Networking 1 04-30-2004 09:16 AM


All times are GMT -5. The time now is 06:24 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration