Find the answer to your Linux question:
Results 1 to 9 of 9
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    1

    Simple Networking Problem


    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

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    On the server turn FORWARD'ing on if the client is to use this as it's gateway to the internet. Traffic is not allowed to pass through the server if it is not setup o forward the traffic. Make sure you have a good firewall setup.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    Forwarding per se is not going to do it. You'll need NAT set up on the server. Easiest way for you is likely to be installing Firestarter, although some iptables gurus here may tell you how to do it manually.

  4. #4
    xps
    xps is offline
    Just Joined!
    Join Date
    May 2009
    Location
    Western USA
    Posts
    2
    Also (used to be) if you connected Nic to Nic.. you would need a crossover cable...

  5. #5
    Just Joined!
    Join Date
    Feb 2009
    Posts
    22
    Quote Originally Posted by greyhairweenie View Post
    Forwarding per se is not going to do it. You'll need NAT set up on the server. Easiest way for you is likely to be installing Firestarter, although some iptables gurus here may tell you how to do it manually.
    I also had similar issue, solved it by following these steps:

    1. Enable IP-forwarding on the server machine

    echo 1 > /proc/sys/net/ipv4/ip_forward
    there is 1 sysclt command to do it this way
    sysctl -w net.ipv4.ip_forward=1
    2. Enable Source NAT'in of the out going packets. Assuming your eth0 is connected to Internet.
    iptables -A POSTROUTING -t nat -o eth0 -j SNAT --to-source <x.x.x.x>
    here x.x.x.x is the IP assigned to interface eth0.

    3. After applying step 2. your packets will reach the destination and back to your eth0 but you have to Make sure that the packets are not blocked by the firewall while transiting back from eth0 to eth1 (assuming this is connected to your client machine).

    iptables -I FORWARD -t filter -i eth0 -o eth1 -j ACCEPT
    This should make your packets finally reach your LAN host i.e the client machine. Incase they don't just keep sniffers like wireshark/tcpdump ready on server machine and you can easily figure out at what point they are getting blocked by the firewall.

    In case you have any issues, do post the output of sniffer.

  6. #6
    Just Joined! spg666's Avatar
    Join Date
    Dec 2008
    Location
    UK
    Posts
    24
    If you are using the asus as the server and it's running the xandros distribution it shipped with, your going to have some fun with IP Tables! The kernel doesn't support them, however you can install kernel support/IP tables by following the guide in the wiki on eeuser.com you can find the link in the security section....

    (I'm not allowed to post links yet)

  7. #7
    Just Joined!
    Join Date
    Feb 2009
    Posts
    22
    Quote Originally Posted by spg666 View Post
    If you are using the asus as the server and it's running the xandros distribution it shipped with, your going to have some fun with IP Tables! The kernel doesn't support them, however you can install kernel support/IP tables by following the guide in the wiki on eeuser.com you can find the link in the security section....

    (I'm not allowed to post links yet)
    For configuration options, they are well explained in tutorial:

    iptables 1.2.2 (just google search with this string as a token/key, i too am not permitted to post a link yet)

  8. #8
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    Quote Originally Posted by xps View Post
    Also (used to be) if you connected Nic to Nic.. you would need a crossover cable...
    Not likely to be an issue here since the problem report states he can see files on the server from the client.

  9. #9
    Just Joined!
    Join Date
    Mar 2003
    Location
    CT
    Posts
    11
    Can you post a rough diagram of your network setup, I am having a hard time visualizing it it would go a long way to seeing If I can help. It might assist others in assisting you too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •