LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-21-2004, 12:14 PM   #1
hkl8324
Member
 
Registered: Aug 2003
Location: Hong Kong, China
Distribution: Ubuntu 10.04
Posts: 234

Rep: Reputation: 30
NAT sharing problems...


i have the machines, one is linux box and the other is Win XP box, i want the use the linux box to share internet access using NAT, but i got some problems...

server setting:
os:redhat9
eth0:
DEVICE=eth0
BOOTPROTO=dhcp
BROADCAST=192.168.100.255
IPADDR=192.168.100.1
NETMASK=255.255.255.0
NETWORK=192.168.100.0
ONBOOT=yes

eth1:
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

nat setting:
iptables -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FPRWARD -d 162.168.1.0/24 -j ACCEPT
iptables -A FPRWARD -s 162.168.1.0/24 -j ACCEPT

client setting:
os:winxp pro
setting:
ip adress:192.168.1.135
subnet mask:255.255.255.0
default gateway:192.168.1.2
preferred DNS server:202.45.84.58
alternate DNS server:202.45.84.59

The problem is that my linux box can get online while my XP box cannot, but the two machines can ping each other, whats wrong with my setting, could somebody help me out...

thanks in advance
 
Old 08-30-2004, 02:31 AM   #2
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
is the above then entire firewall script? what are the default policies for the FORWARD, INPUT and OUTPUT chains?

before you start though have you read NAT HOWTO section on MASQERADING?

Start there maybe and see how you go
 
Old 09-03-2004, 04:13 AM   #3
prakashstephen
LQ Newbie
 
Registered: Sep 2004
Posts: 1

Rep: Reputation: 0
Are you using any type of proxy?If you are using squid as a proxy you have to put the ipaddress(192.168.100.1)and port number(3128) in client.This will solve ur problem.........
 
Old 09-03-2004, 04:35 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
hope ip_forward-ing is enabled
 
Old 09-03-2004, 07:26 AM   #5
bruj3w
Member
 
Registered: Mar 2004
Location: england
Distribution: slackware
Posts: 164

Rep: Reputation: 30
Re: NAT sharing problems...

both the interfaces in your linux box have ips in the private address range, how on earth is it on the internet?

you want your eth1 (lan interface) to have a static address, which you have.

the xp settings look right too.

you need to enable ipforwarding as said by a previous poster, echo 1 > /proc/sys/net/ipv4/ip_forwarding (off the top of my head)

you say your, xp box cant get on the internet, is it that or is dns simply not working?

Last edited by bruj3w; 09-03-2004 at 07:29 AM.
 
Old 09-03-2004, 08:20 AM   #6
mancini
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware
Posts: 16

Rep: Reputation: 0
there is no problem with him getting on the internet with private ip's on both interfaces as long as he has the default gateway to a server of his isp's wich forwards/routes his trafic on the net

Quote:
iptables -A FPRWARD -d 162.168.1.0/24 -j ACCEPT
there is a typo there , FPRWARD instead of FORWARD

btw scientific study discovered that the human brain gets trained to only read the first and the last characters of words and deduct the rest
 
Old 09-03-2004, 09:45 AM   #7
bruj3w
Member
 
Registered: Mar 2004
Location: england
Distribution: slackware
Posts: 164

Rep: Reputation: 30
yeah, i know that but his intial post reads like he only has 2 boxs, one xp, one linux, and hes using the linux box as a gateway...

maybe im missing something :/
 
  


Reply



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
NAT- Internet Sharing sarfaraz_ic Linux - Newbie 5 02-04-2005 05:32 AM
problems with nat alaios Linux - Networking 3 11-17-2004 09:03 PM
problems with iptables NAT figjam Linux - Networking 1 06-14-2004 07:49 PM
Redhat 9 NAT problems ninjaz Linux - Networking 1 08-13-2003 08:01 PM
iptables-nat problems didget Linux - Security 8 12-13-2001 02:15 PM

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

All times are GMT -5. The time now is 08:14 PM.

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