LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Linux routing on a dual homed pc (https://www.linuxquestions.org/questions/linux-networking-3/linux-routing-on-a-dual-homed-pc-331117/)

friendklay 06-07-2005 03:02 AM

Linux routing on a dual homed pc
 
Hi have setup internet sharing on a dual homed pc, but don't no much about routing commands to use. The setup I have is as follows


WWW>>>eth0>>>eth1>>>Switch>>>LOCALNAT COMPS

External: eth0::192.168.1.253/24 Gateway:192.168.1.1
Internal: eth1::192.168.0.254/24 Gateway:192.168.1.253

My local machines can't ping outside. What's amiss? What do I do?

abhishek124 06-07-2005 04:35 AM

ow to enable routing
 
to enable routing in your PC ,
#vi /etc/sysctl1.conf [change o to 1]
Net.ipv4.ip_forward=1
Then you need to configure squid on your router

vi /etc/squid/squid.conf

http_port =3128
cache_mem=8mb

cache_dir ufs /var/spool/squid 100 16 256

acl localhost src 127.0.0.1/255.255.255.255 ( Change the Ip address to your Internal Ip address)

http_access deny all (Change Deny to Allow)

friendklay 06-08-2005 04:09 AM

Re: Linux routing on a dual homed pc
 
I think I have to clarify. My setup is as follows:

Quote:

Originally posted by friendklay

External: eth0::192.168.1.253/24 Gateway:192.168.1.1
Internal: eth1::192.168.0.254/24 Gateway:192.168.1.253

What I have done so far is execute these in command shell (as suggested by aaa)

Code:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Code:

iptables -A FORWARD -i eth1 -j ACCEPT
Code:

echo 1 > /proc/sys/net/ipv4/ip_forward
However, I can't ping outside. What's wrong? Please help.

abhishek124 06-08-2005 08:45 AM

Please check your gateway its wrong

This Command
echo 1 > /proc/sys/net/ipv4/ip_forward
is for a particular session only, after reboot you need to configure it anyway.
Why are maqurading IP tables.
Do this chkconfig iptables off
service iptables stop
and follow my above configuration

abhishek124 06-08-2005 10:01 AM

to enable routing in your PC ,
#vi /etc/sysctl1.conf [change o to 1]
Net.ipv4.ip_forward=1
Then you need to configure squid on your router

vi /etc/squid/squid.conf

http_port =3128
cache_mem=8mb

cache_dir ufs /var/spool/squid 100 16 256

acl localhost src 127.0.0.1/255.255.255.255 ( Change the Ip address to your Internal Ip address)

http_access deny all (Change Deny to Allow)


All times are GMT -5. The time now is 10:07 PM.