LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-26-2006, 04:55 PM   #1
JussiKp
Member
 
Registered: Aug 2006
Posts: 49

Rep: Reputation: 15
Debian: Home router / NAT / Firewall


I've followed this guide http://www.cyberdogtech.com/firewall...php?page=inter till setting up DNS (I've not done that yet).

My cabling goes like this:

--------[VDSL modem]------[home router PC]--[D-link ethernet switch]--[another PC]

All cables are the same RJ-45. My connection is PPPoE. There's two NICs in my router pc.

My /etc/network/interfaces looks like follows

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet ppp
provider dsl
pre-up /sbin/ifconfig eth0 up

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
I use rp-pppoe. (adsl-start etc)

Now /etc/init.d/networking restart brings up my network. I'm sorry I can't at the moment paste my ifconfig's output here, but there is one pppX interface and eth0 and eth1, one having IP 192.168.1.1.

In adsl-setup I tried both setting firewall 0 (not at all) and 1 (desktop usage). I thought 0 would be suitable because of explicit shorewall configuring.


Should I have some special settings on my client Gentoo machine which is connected to the switch? My PPPoE settings are set according to http://gentoo-wiki.com/HOWTO_Connect_using_PPPoE. I do not use rp-pppoe but instead of that /etc/conf.d/net & /etc/init.d/net.ppp0 thing as shown in HOWTO.

This is from my client computer:
Code:
config_eth0=( "dhcp" )
config_eth1=( "dhcp" )

#modules=( "wpa_supplicant" )
#wpa_supplicant_eth0="-Dipw"
#wpa_timeout_eth0=60

config_ppp0=("ppp")
link_ppp0="eth0"
plugins_ppp0=("pppoe")
username_ppp0='foo'
password_ppp0='example'
pppd_ppp0=("defaultroute" "usepeerdns")
I was able to see from router computer's /var/log/syslog or /var/log/messages that my client computer send a DHCP request to my router when I ran /etc/init.d/net.ppp0, but still I was unable to access the Internet and ifconfig did not show any IP assingned to my network interface.

--- Thanks.

Last edited by JussiKp; 01-02-2007 at 12:36 PM.
 
Old 12-26-2006, 06:07 PM   #2
chrisortiz
Member
 
Registered: Nov 2005
Distribution: Slackware, and of course the super delux uber knoppix universal live recovery cd
Posts: 429

Rep: Reputation: 30
can [home router PC] connect to the internet?
 
Old 12-26-2006, 11:23 PM   #3
JussiKp
Member
 
Registered: Aug 2006
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrisortiz
can [home router PC] connect to the internet?
Yes it can.
 
Old 12-27-2006, 01:10 PM   #4
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
Things I would check, pretty much in order:

1. You say you have internet at the router, so that's good.

2. Make sure you are using "straight-through" ethernet cables and not "cross-over" cables. The latter are for connecting NIC-to-NIC, the former for NIC-to-switch.

3. You need to have your IP configured in the Gentoo box. If you have trouble with getting DHCP to work, you can just set it up manually, something like: 'ifconfig eth0 netmask 255.255.255.0 broadcast 192.168.1.255 192.168.1.2'. That's for the Gentoo box. You should then be able to do 'ifconfig eth0' to check it. If the IP takes hold, but not broadcast, just do the first command again. Done right, you should be able to ping the router: 'ping 192.168.1.1'. If no joy, there's no need to go forward. If doing 'ifconfig eth0' says that eth0 is not found or whatever, you need to check that you have loaded the right driver for the NIC.

4. To share Internet, you *must* have your firewall configured for masquerading (NAT). A fully open firewall will connect the router to the world, but the Gentoo box won't get through. I still haven't figured it out, but what got me through was a yoLinux tutorial and also the Firestarter firewall program.

Almost forgot to mention routing: the Gentoo box must have the router NIC (192.168.1.1) as the default route or gateway.

Last edited by drakebasher; 12-27-2006 at 01:18 PM.
 
Old 12-27-2006, 03:56 PM   #5
chrisortiz
Member
 
Registered: Nov 2005
Distribution: Slackware, and of course the super delux uber knoppix universal live recovery cd
Posts: 429

Rep: Reputation: 30
try
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
then at the client try
Code:
68.230.242.30
thats one of googles servers. If you can ping it from the client, then set up DNS and your set. I would recamend that you set up your router as a "dns forwarder"
 
  


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
Iptables Firewall Router Nat Problems Aps Linux - Networking 5 07-28-2006 03:49 AM
problem update via router with NAT and Firewall qinelo Linux - Networking 1 01-13-2006 04:03 PM
What FireWall & NAT for home LAN? fipeso Linux - Newbie 6 04-19-2005 02:41 PM
LICQ file transfer/NAT firewall-router Scruff Linux - Security 8 11-05-2003 11:39 AM
router/firewall/nat/dhcp with 5 NICs? nicedreams Linux - Networking 13 06-21-2003 02:26 PM

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

All times are GMT -5. The time now is 10:54 AM.

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