how to route packets for internet

i am having a LAN which is connected to main proxy server through switch. In that LAN if i isolate a PC with single network with single PC and attach it to another computer which have 2 LAN cards in that LAN then can i access internet through that computer?

cranium2003Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
reketnetConnect With a Mentor Commented:
Hi ,
from here download your proxy server http://www.squid-cache.org/Versions/v2/2.5/ , then read this http://squid.visolve.com/squid/sqguide.htm and step by step you will configure your proxy server. Then make the second lan card with private ip address and enable the ip_forwarding and with iptables make you SNAT iptables -t nat -A POSTROUTING -s your_private_Ip/255.255.255.0 -j SNAT --to-source "your_lan_ip" manage your INPUT OUTPUT and FORWARD policies and you are ready.

regards,
0
 
reketnetCommented:
Ofcource you can , just you need to know how to configure the OS of that computer so share its internet connection and you will have internet ,too. Tell us what the OS is and we will tell you how you can do that.If it is linux you have to enable ip_forwarding and configure the masq. or to make SNAT. If Windows you need to enable internet connection sharing.

regards,
0
 
sykatCommented:
In Windows you can also use proxy server named "Wingate Proxy Server", "WinProxy" etc for internet connection sharing. Make sure that in that case disable "Internet Connection Sharing" option.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SunjithCommented:
The following commands should enable you to access internet through that computer:
-----
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
------
 Where eth1 is the interface which connects to the internet. You may add the above commands to any initialization scripts so that reboots won't be a problem. You may also want to run a DNS server on that computer or configure all systems to query your ISP's DNS servers.
0
 
cranium2003Author Commented:
hi reketnet,
          I am using Redhat 9 on all my computers with default kernel installed. please tell me how can i configure it to able to access internet from my own proxy server created by me in my LAN. Before can you help me to setup my router PC having two LAN cards as proxy server?
0
 
cranium2003Author Commented:
hi reketnet,
          I am using Redhat 9 on all my computers with default kernel installed. please tell me how can i configure it to able to access internet from my own proxy server created by me in my LAN. Before can you help me to setup my router PC having two LAN cards as proxy server?
0
 
nickichCommented:
Hello,

If you have internet on eth0, and you have attached PC on eth1 -


route add default gw IP_eth0  // where IP_eth0 is IP on interface eth0 (your real inet IP)

iptables -t nat -A POSTROUTING -s your_target_pc_ip  -j MASQUERADE


 your_target_pc_ip  is IP on this PC you want internet.

Good  Luck!
0
 
cranium2003Author Commented:
hello nickich,
         As you said i did it my alone pc has ip 192.168.1.192 and router pc has eth0 10.0.0.199 and eth1 192.168.1.1
now i have one more pc on lan netid 10.0.0. with ip 10.0.0.76. but i am unable to ping from 192.168.1.192 to 10.0.0.76 but able to 10.0.0.199.
Also how can i access internet in mozilla. give me wihch settings to use as proxy in mozilla.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.