Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
HI,
I have two network cards in my computer (Debian). One (eth0) is connected to the router which is connected to the internet, the other one (eth1) is connected to my laptop (Gentoo). Now I want to surf the web both on my computer and on my laptop. I obeyed some tutorials "Linux as router":
1. On my Debian system IP-Forwarding is on:
2. Laptop has IP 192.168.0.2 and this is the output of 'cat /etc/network/interfaces' on my computer:
Code:
takada:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# eth0
auto eth0
iface eth0 inet static
address 192.168.1.97
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# eth1
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
But a ping from my laptop to 192.168.1.1 (router to internet) still gives:
Ok, two obvious things missing, at least in your info provided
1) is the laptop configured with a default route of the debian box?
2) you need to further a) also use iptables masquerade to source nat the traffic from your laptop to come from it's eth0 addres OR b) ensure that the actual internet router knows how to get back to the laptop address, I.e. write via the debian box.
Yes, laptop is configured with with a default route to 192.168.0.1 (actually it wasn't when I posted the output of "ping 192.168.1.1" from laptop, but I tried that earlier already; with that default gateway the output changes to 100% packet loss instead of "Network is unreachable").
To 2) I'd rather take option b). So I looked up the configuration page of my router. There's a category 'Static routes' which asks for the IP-Destination, IP-Subnetmask, IP-Gateway and metrics. I tried with "192.168.0.2", "255.255.255.0", "192.168.1.97" and "2", but it has no effect. Is there someone with an idea what to do??
ok, well the "IP-Destination" would be "192.168.0.0" but other than that it looks ok. You should now be at the level of iptables firewalling on the debian box. are you permitting traffic in the "FORWARD" table?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.