Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Networking Problem 2

Status
Not open for further replies.

WebCaesar

Programmer
Jun 23, 2010
2
RO
Hello,

I have 2 laptops connected by a lan cable - from 1 laptop network card to the other.

the first laptop is an Asus eeePc that runs a modified version of debian.
this one is connected to the internet and i simply want the other one to connect to the internet via the lan cable.

--------------------------------------------------

the "server" has 2 connections:
1. one for connecting to the internet via a dialup mobile connection (i checked and this connection is shared)

2. the 2nd connection: "Local Area Connection" defined this way:
IP address: 192.168.0.4
subnet mask: 255.255.255.0
+ it is also marked as 'shared'
that's all, no Gateway/DNS/Wins defined

--------------------------------------------------

the "client" (Debian 5.0 Lenny) has its own "Wired connection" defined this way:
Configuration: Static IP address
ip addreess: 192.168.0.3
subnet mask: 255.255.255.0
Gateway: 192.168.0.4

--------------------------------------------------
my problem is that the client (192.168.0.3) cannot open web pages even if it sees just fine the server's files.

please let me know what can i do to fix this.

thanks,
Andy
 
You either need to turn on routing on the "server" or to use something like WinRoute or WinProxy to handle the connections. One alternative is to bridge the connections but I can't remeber if this has other side effects.

What's happening is the "server" doesn't know to pass on the web traffic from the client. If it were Server 200/2003 there is a specific routing command but my understanding is there is a registry hack which can do this.

Honestly though - is it really worth the effort? A cheap router can be had for £15 which means you don't need to hack around with one system to make the other work and a router usees less power and is simpler to set up... go on get in to real networking!

:-D



 
If I understand your post correctly, the internet connected machine that you wish to use as a gateway is running Debian.

If this is the case, you would need to do three things:
1 - make sure that the PCs can see each other on the LAN and each has a unique IP address. I assume you have already done this, but would rather state the obvious than leave something out.

2 - turn on IPV4 forwarding on the gateway machine.
To do this permantly, set net.ipv4.ip_forward = 1 in /etc/sysctrl.conf

3 - use IPTables to perform the IP masquerading.
iptables -t nat -A POSTROUTING -o (your interet interface)-j MASQUERADE

This will perform the NAT between the internet addresses and your local LAN for the connected client.

 
Noway2,

thank you very much for you post.

#1 - the pc's can see each other just fine - via both samba and http

#2 - i changed /etc/sysctl.conf file y uncommenting the line:
net.ipv4.conf.default.forwarding=1

#3 - what value shall i use for "(your interet interface)" in
"iptables -t nat -A POSTROUTING -o (your interet interface)-j MASQUERADE"?

i tried "iptables -t nat -A POSTROUTING -o test -j MASQUERADE" and received:

FATAL: Module ip_tables not found.
iptables v1.3.6: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


Thanks a lot for your time!

 
Your interface is probably eth0, which is the default wired ethernet port. You can find out what interfaces are available using the command ifconfig. You will want to use whatever interface is tied to your Internet connection you are trying to share (the output).

You received a strange error. Debian does support iptables, which is typically the default firewall. Perhaps it was not installed in your installation? It is used for routing functions too. You will undoubtedly need to execute the instruction as a privileged user, though.

For starters, this link may be of benefit:
I came across that one from this post:
 
Sorry - I read the "Server" as XP or at least windows as it mentions "Local Area Connection" if this IS the case then routing needs to be established on the XP host.

If I'm mistaken apologies - I still suggest a cheap router mind you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top