Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
Network Troublshooting => General Networking Support in Linux => Topic started by: hitesh on November 29, 2004, 07:00:43 PM
-
Hi ricky,
This is Hitesh. This is my first post this forum. I have read your artical with following link and try to share internet. http://www.linuxsolved.com/forums/ftopic115.html
My home network setup:
On RHEL 3:
eth0
ip: 192.168.100.20
netmask:255.255.255.0
This is eth0 details on Linux BOX.
# Realtek|RTL-8029(AS)
DEVICE=eth0
onBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.20
NETMASK=255.255.255.0
GATEWAY=192.168.100.254
HWADDR=00:80:AD:89:E98
On Windowxp:
eth0
ip: 192.168.100.10
netmask:255.255.255.0
gateway: 192.168.100.20 [RHEL box ip address]
DNS: 203.94.227.70 [auto getting on linux box]
Every thing i have done what ever you have given under above link. BUT
1) If i up the eth0 and try to ping to 192.168.100.10 [windows pc] , i can ping to that PC. BUT at the same if I try to surf the internet, browser status showing it "looking for the www.yahoo.com" , i can NOT able to surf the net.
2) In BWT if I down eth0 using ifdown eth0 , still i can NOT surf net. So i have to reconnect the dial up modem. then ONLY i can surf the net.
Question:
1) how can i share inernet with windowXP PC? As soon as i up eth0 very next time i can NOT able to share the net.
2) is there any thing wrong with eth0? as i have connect two PC with HUB. what else i have to do to share the net.
Please help me...
Thank you,
Hitesh
-
Are you sure your NAT script is being executed properly ? Also Your problem is of DNS, try to use other DNS server in XP box. You can use MTNL's name server to give try. Here are they !
202.134.192.10
202.134.192.11
202.54.15.30
You have specifid gateway as 192.168.100.254 in etho in RHEL. Using gui left it blank.
Else is fine !
-
Thank you! for the reply Ricky,
I have resloved this problem with commented GATEWAY=xxx.xxx.xxx.xx option under /etc/sysconfig/network-script/ifcfg-eth0 file.
Now eth0 is up and i can ping to windows PC. but still NET sharing not working when i try to access from windows PC. YES, I have given Linux BOX Ip address as gateway in IE and set the porxy server.
what else i have to do the share the net with other PC.
By the way could you tell me HOW DID YOU KNOW THAT IT'S MTNL's NAME SERVER? I am interested to know about this.....
Please help me...
-/Hitesh
-
PC. YES, I have given Linux BOX Ip address as gateway in IE and set the porxy server.
what else i have to do the share the net with other PC.
By the way could you tell me HOW DID YOU KNOW THAT IT'S MTNL's NAME SERVER? I am interested to know about this.....
Please help me...
-/Hitesh
You are still doing wrong.. just leave the gateway option blank in Redhat for eth0 , you can do that yby redhat-config-network
And why you are using PROXY in IE setting ? hmm. have installed proxy server also on RH ?
BTW.. if you are doing simple NAT then you have to only set up the gateway as IP of the server machine (Linux Box) in the client machine and you can access NAT on client, no need to set IE to use proxy.
Those are BSNL name servers.
to find those just connect using bsnl and see /etc/resolv.conf
that way what ever connection u are using , u can find thier nameserver.
-
Sorry Ricky, but i do not know why i can not do the simple thing. same on me..
see i have try again, here it what i have done...
First on redhat box:
assign ip add: 192.168.100.20 [on eth0]
Gateway: Blank [as you suggest]
check below:
# Realtek|RTL-8029(AS)
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.20
NETMASK=255.255.255.0
GATEWAY=
HWADDR=00:80:AD:89:E9:D8
I have save rc.nat file under /etc/rc.d/ip.nat
and also make executable with chmod 755 and also mention line under /etc/rc.d/rc.local
Now on Widnows Pc.
open TCP/IP propertices:
ipaddress: 192.168.100.10
subnet mask:255.255.255.0
default gateway: 192.168.100.20 [redhat box ipaddress]
Preferred DNS server: 203.94.227.70 [from rehat box which i am getting through MTNL when connecing suing modem]
Aleternate DNS server: 203.94.243.70
I have not setup anything under IE proxy and try.. then it show
"The page cannot be displayed."
if i give RHLBOX ip (192.168.100.20 port 80) then it show RHL defaults homepage which i have setup under /var/www/html/index.html
So i think it getting RHL box defaults home page. [the Test page]
Haa. I have setrup squid proxy on my RHL box. Also, i have stop that service and tried but still not working .
I know this is really simple stuf, i do not why i ma not getting any web site. page.
Please help me to sloved this issue.
Thank you! again for your important time.
-/Hitesh
-
if i give RHLBOX ip (192.168.100.20 port 80) then it show RHL defaults homepage which i have setup under /var/www/html/index.html
Because you have Apache server configured by default.
Now..
Can you give me output of the following command (it will either 0 or 1)
cat /prox/sys/net/ipv4/ip_foward
Then i will suggest u further.
-
When i check with /proc/sys/net/ipv4/ip_foward file.
it showing 1
please help me...
Thank you!,
-/Hitesh
-
I found this little script when I was doing mine and after running it I could share my modem fine. Just save it somewhere, /sbin or /usr/sbin, then type in sh <name if script>.
Here is the script:
#!/bin/bash
IPTABLES='/sbin/iptables'
# Set interface values
EXTIF='ppp0'
INTIF1='eth1'
INTIF2='eth2'
# enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X
# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
# forward LAN traffic from $INTIF2 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF2 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
#echo -e " - Allowing access to the SSH server"
$IPTABLES -A INPUT --protocol ssh --dport 22 -j ACCEPT
#echo -e " - Allowing access to the HTTP server"
$IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT
# block out all other Internet access on $EXTIF
$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,INVALID -j DROP
$IPTABLES -A FORWARD -i $EXTIF -m state --state NEW,INVALID -j DROP
Hope that helps. I'm no expert at this though. I just found a script that worked for me.
Later
:D :D :D :D
-
When i check with /proc/sys/net/ipv4/ip_foward file.
it showing 1
please help me...
Thank you!,
-/Hitesh
It means routing is enabled , I think you should start from scratch.. ie.. try to redo all freshely
-
Ricky,
I try and again from scratch and now it's working fine, Thank you very for the help.
but now new problem, i have share some folders between windows to RHEL 3.
I tyr to explain here.
i have started my Linux box and once it up if i try to access net from windows machin i m getting net, but if i try to access some windows sharble data from Linux i can able to access , then again if i try to access net that i can not , i do not why...
this happen, it should work.
I have restart both the services (SMB and iptables)
Also, I have set the rc.ipmasq file path under /etc/rc.d/rc.ipmasq, but if i check with iptables -nL routing not enable.
Then i have to run manualy. in both cases still i am not able to access net from windows PC. why?
pls help me .
haa, some time i can able to access both (shareble data and net)
Thank you! for ur help.
-/Hitesh