LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-27-2004, 01:18 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
help to join 2 network ID PCs in single LAN


i am having a LAN which is connected to main proxy server ip 10.0.0.xxx through switch. In that LAN if i isolate a PC with single network with single PC with ip 192.168.1.192 and attach it to another computer which have 2 LAN cards in that LAN,eth0 is 10.0.0.199 and eth1 is 192.168.1.1 then can i access internet through that computer with ip 192.168.1.192?
 
Old 10-27-2004, 02:29 AM   #2
n3tw0rk
Member
 
Registered: Sep 2003
Location: Rawalpindi, Pakistan
Distribution: Slackware
Posts: 86

Rep: Reputation: 15
Yes you can access the Internet on 192.168.1.192 by setting up Network Address Translation (NAT) on the multi-homed system (eth0:10.0.0.199, eth1:192.168.1.1). For help on how to do this visit http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/ . You can also setup a proxy server on the multihomed system but i think setting up NAT is a better choice as only one machine (192.168.1.192) from the 192.168.1.0 network requires access to the Internet.
 
Old 10-27-2004, 02:58 AM   #3
shy
Member
 
Registered: Dec 2002
Location: Russia
Distribution: ASP linux
Posts: 94

Rep: Reputation: 15
Re: help to join 2 network ID PCs in single LAN

Quote:
Originally posted by cranium2004
i am having a LAN which is connected to main proxy server ip 10.0.0.xxx through switch. In that LAN if i isolate a PC with single network with single PC with ip 192.168.1.192 and attach it to another computer which have 2 LAN cards in that LAN,eth0 is 10.0.0.199 and eth1 is 192.168.1.1 then can i access internet through that computer with ip 192.168.1.192?
You should add the following rules to PC1's iptables:

-t nat -A POSTROUTING -s 192.168.1.192 -o eth0 -j SNAT --to-source 10.0.0.199
-t filter -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-t fileter -A FORWARD -i eth1 -o eth0 -j ACCEPT

don't forget to run
echo 1 > /proc/sys/net/ipv4/ip_forward

I hope I didn't forget anything...

Hope this helps.
 
  


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
Connecting a single ethernet port to multiple PCs? beejayzed Linux - Networking 14 09-08-2005 04:14 PM
Setting up a direct LAN between 2 PCs Mr_Nightmare Linux - Networking 3 08-31-2005 07:58 PM
Linux as Gateway in a LAN out of 20 PCs stormblast Linux - Newbie 2 04-30-2004 12:22 AM
trying to to join a LAN/Internet fooforon Slackware 8 09-03-2003 10:19 PM
RH9 PRINTER SERVER. PCs IN LAN DONT PRINT Juliancito Linux - Networking 0 07-01-2003 02:34 PM

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

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