Netstat -rn

Posted on 2005-04-16
Last Modified: 2008-01-09
Can anyone help me translate this... I've got a connectivity problem
after switching to ADSL using ppoe.

I'd like to know if what each line looks ok, or if there is potential problem.
Specifically traffic from internal eth1 is being forwarded out my eth0 external ip?

root@som:~> netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface UH        0 0          0 ppp1   U         0 0          0 eth0   U         0 0          0 eth1       U         0 0          0 lo           UG        0 0          0 ppp1


Question by:jjbarnsley

    Expert Comment

    Could you please more specific about your connectivity problem?
    Your routing table looks fine for standard ppp client.
    LVL 51

    Expert Comment

    Cc: what is the problem?
    LVL 38

    Accepted Solution

    >           UG        0 0          0 ppp1
    It means your default gateway is passing through ppp1 interface.

    But you have another WAN IP on eth0 (
    $ nslookup


    I would say you either use eth1 as your default gateway interface (not use ppoe) or
    disable eth1.

    2 WAN interfaces without properly configuration will loop and packet lost.
    That's your main problem.
    LVL 19

    Assisted Solution

    I would say this:

    eth1 is Local Area Network
    eth0 has a public ip address, but it's not used since eth0 is used for pppoe.

    what I think is you want to share internet using this computer, and do not know why it is not working, or if it is secure.

    you need to have a firewall, which is the point where you share the internet also.

    this is a firewall that should work for you:
    #Activate IP Forwarding
    echo 1 > /proc/sys/net/ipv4/ip_forward

    ipt=`which iptables`

    $ipt -F
    $ipt -t nat -F
    $ipt -t mangle -F
    $ipt -P INPUT DROP
    $ipt -P FORWARD DROP

    $ipt -A INPUT -i lo -j ACCEPT
    $ipt -A FORWARD -i $inside -j ACCEPT

    # This is for stateful firewall:
    $ipt -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    $ipt -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

    # The INPUT section is where you allow access to services hosted on your
    # linux server, like tcp:80 (HTTP) or TCP:21 (FTP):
    #Accept at least traffic to ssh into this host.
    $ipt -A INPUT -p tcp --dport 22 -j ACCEPT

    # Here is the NAT part, where you share internet access.
    $ipt -t nat -A POSTROUTING -o $outside -j MASQUERADE

    I would say you need to be careful and make the firewall to have the output interfase in ppp0, since ppp1 is only used when ppp0 is already taken or when you disconnect and connect too fast. therefore, you should be using normally ppp0.
    put it on the outside variable with outside=ppp0, and the firewall will protect your computer and your internal network, while sharing internet access.

    please do not forget to add the DNS to your client computers. if you want linux to be a dns cache, just start your dns service (service named start) and you should be able to use the internal ip of your linux box as a default gateway and dns for internet access.

    hope I understood the problem

    Author Comment

    thanks for your comments.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    This video discusses moving either the default database or any database to a new volume.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now