LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Debian: Home router / NAT / Firewall (https://www.linuxquestions.org/questions/linux-networking-3/debian-home-router-nat-firewall-513882/)

JussiKp 12-26-2006 04:55 PM

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.

chrisortiz 12-26-2006 06:07 PM

can [home router PC] connect to the internet?

JussiKp 12-26-2006 11:23 PM

Quote:

Originally Posted by chrisortiz
can [home router PC] connect to the internet?

Yes it can.

drakebasher 12-27-2006 01:10 PM

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.

chrisortiz 12-27-2006 03:56 PM

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"


All times are GMT -5. The time now is 02:36 PM.