LinuxQuestions.org
Review your favorite Linux distribution.
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 04-15-2006, 03:22 AM   #1
wangqian
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
Unhappy a problem about NAT


hi,evey one, i want use my computer to be a router,so i install debian ,and 2 network cards on it.and then,i install dhcpd,edit/etc/dhcpd.conf like that

subnet 192,168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.10;
}

and bulud the table chain with this command:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

,and then i bound the eth0 with 192.168.0.1/24(use eth0 to connect with the subnet),use eth1 to connect with internet(i use adsl to connect with internet),

then ,i test the router, there is the problem: i am in the subnet, can connect with both eth1 and eth0(i use ping to do that),but i can't connect with internet,i don't konw why?any one can help me?

thanks a lot!
 
Old 04-15-2006, 03:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
you would still need to enable the routing, as all that iptables line does is enable masquarading of traffic once it is routed. to enable routing (ip forwarding) do "echo 1 > /proc/net/ipv4/ip_forward" or similar.. i forget the exactly location under /proc.
 
Old 04-15-2006, 04:38 AM   #3
wangqian
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Original Poster
Rep: Reputation: 0
i am sorry ,i forgot to write it ,but,i did that,edit the file /etc/network/options ,and open the ip_forwarding

Last edited by wangqian; 04-15-2006 at 04:40 AM.
 
  


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
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 06:50 AM
NAT problem Obscure Linux - Networking 1 03-05-2004 08:06 AM
NAT problem Comatose51 Linux - Networking 1 06-23-2003 11:41 PM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 05:07 AM
RH 7.3 NAT problem guanyu Linux - Networking 13 07-02-2002 06:52 AM

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

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