Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Determine which eth card is internal/external

  1. #1
    Join Date
    Jun 2008
    Location
    Connecticut, USA
    Posts
    2,295
    Blog Entries
    1

    Default Determine which eth card is internal/external

    I need help with setting up this router!

    I have gone through the Cool Solutions:SUSE Router How-To about 4-40 times now.

    For whatever reason internal pings use the external NIC and external pings use the internal NIC.

    How can I manually tell the system which NIC to use for which purpose?!

    • I've set the DNS and Hostnames
    • I've set the eth1 with static (internal) and eth0 with DHCP (external) IP address
    • I've set the Routing to use the internal IP, the DSL modem and to my mother's birth date! (just kidding)
    • I've set the internal NIC card to act as a DHCP server
    • If I do not have the external NIC plugged into the router, then sometimes I can SSH into the system.
    • I've kicked it once and that didn't fix it.
    • I'm at the stage of making random changes in Yast to see if that helps (yes, I am getting that desperate!)


    I am getting frustrated about this and no matter how many times I go through the darn tutorials and how-to's it isn't working!

    btw, I'm using 10.2 and yes I have looked at both Cool Solutions (for 9x and 10x).

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Determine which eth card is internal/external

    Which interface a packet goes to depends on the destination in the packet and the routing. I assume that you have set up the interface addresses and routing correctly, but if you post, maybe we can double check.

    Are you sure you know which physical cards are eth0 and eth1? In the case of identical models, detection is usually in order of PCI bus order. If the cards have LEDs, there is a utility called ethtool. You can use the --blink feature to check which is which.

    ethtool --blink eth1 10

    Blink the link LED for 10 seconds

  3. #3
    Join Date
    Jun 2008
    Location
    Connecticut, USA
    Posts
    2,295
    Blog Entries
    1

    Default Re: Determine which eth card is internal/external

    Quote Originally Posted by ken_yap View Post
    Which interface a packet goes to depends on the destination in the packet and the routing. I assume that you have set up the interface addresses and routing correctly, but if you post, maybe we can double check.

    Are you sure you know which physical cards are eth0 and eth1? In the case of identical models, detection is usually in order of PCI bus order. If the cards have LEDs, there is a utility called ethtool. You can use the --blink feature to check which is which.

    ethtool --blink eth1 10

    Blink the link LED for 10 seconds
    I'll try the blink-test when I get home.

    I've tested which one is which by plugging only one into the switch/DSL modem and seeing which eth gets the IP address (both were set to DHCP). Although I must admit, I am sometimes not 100% sure...

    I've noticed with the routing that the documentation has said to set the Routing to the box's IP address (192.168.1.201) and other documentation says to the modem address (192.168.1.254). Any idea which is it?

    You mention "if you post", is there a partiular output I should post that will help?


    ~Drew
    P.S. Thank you for responding.

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Determine which eth card is internal/external

    Generally the gateway address is that of your router, not the box itself. Post the output of

    Code:
    ip addr
    route -n
    lspci | grep Ethernet
    You should be root to do these commands, or some of them may not be found. Use su -, not su, to become root, to get root's $PATH.

  5. #5
    Join Date
    Jun 2008
    Location
    Connecticut, USA
    Posts
    2,295
    Blog Entries
    1

    Default Re: Determine which eth card is internal/external

    I'm pretty sure I have the right NIC cards. I am connected
    {laptop }--{switch}--{eth0}--{router}--{eth1}--{DSL modem}--{internet}
    and am SSH-ing in to run these commands. The DSL modem is connected directly to the other ethernet card (eth1). What is funny is that the eth0 is a PCI card while eth1 seems to be the onboard connection.

    Just for clarification
    192.168.1.201 = router's internal staic IP
    192.168.1.197 = my laptop (SSH-ed in)
    192.168.1.254 = DSL modem

    ip addr
    Code:
    suserouter:/ # ip addr
    1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:10:4b:29:19:d3 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.201/24 brd 192.168.1.255 scope global eth0
        inet6 fe80::210:4bff:fe29:19d3/64 scope link
           valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:b0:d0:7c:e5:b1 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.64/24 brd 255.255.255.255 scope global eth1
        inet6 fe80::2b0:d0ff:fe7c:e5b1/64 scope link
           valid_lft forever preferred_lft forever
    4: sit0: <NOARP> mtu 1480 qdisc noop
        link/sit 0.0.0.0 brd 0.0.0.0

    route -n
    I notice that both eth0 and eth1 have the same Destination.
    Code:
    suserouter:/ # route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
    169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
    127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
    0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth1
    0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0

    lspci | grep Ethernet
    Code:
    suserouter:/ # lspci | grep Ethernet
    01:09.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]
    01:0c.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)

    Thank you for taking a look at this.
    ~Drew

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Determine which eth card is internal/external

    You have two interfaces on the same subnet:

    Code:
    inet 192.168.1.201/24 brd 192.168.1.255 scope global eth0
    Code:
    inet 192.168.1.64/24 brd 255.255.255.255 scope global eth1
    Both are in the subnet 192.168.1.0/24. And the broadcast address for the second is wrong.

    There will be no difference whether the traffic goes out through one interface or the other, or so the route table thinks. Are you sure you intended this?

  7. #7
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    103

    Default Re: Determine which eth card is internal/external

    yes
    valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:b0:d0:7c:e5:b1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.64/24 brd 255.255.255.255 scope global eth1
    inet6 fe80::2b0:d0ff:fe7c:e5b1/64 scope link
    valid_lft forever preferred_lft forever

    Broadcast and subnet allocation doesn't look like it will work. I advise different subnets for internal and external.

    I have had much more success with the SuSE machine being the gateway. i.e. Modem plugged into eth0 set to DHCP and eth1 handling the routing etc.
    so eth0 10.113.54.X (DHCP)
    eth1 192.168.50.X (STATIC-Routing-DHCP server-DNS-NAT)
    if it aint broken...dont let me near it

  8. #8
    Join Date
    Jun 2008
    Location
    Connecticut, USA
    Posts
    2,295
    Blog Entries
    1

    Default Re: Determine which eth card is internal/external

    So I should change the subnet mask for one of the eth cards in the network card configuration? Like make one 255.255.0.0 and another 255.255.255.0?

    Do they have to be "255"s?

    Since the DSL modem is on 192.168.1.xxx and it assigns an internal IP of 192.168.1.66 to all who connect, should I make the static internal IP like 192.168.0.xxx and netmask 255.255.0.0 in the Network Card configuration?

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Determine which eth card is internal/external

    No, the main problem are not the subnet masks, the main problem is that your subnets overlap. For routing to work, the interfaces must be on non-overlapping subnets. Either your modem/router's DHCP subnet must be changed or the static IP address subnet must be changed. This is Routing 101.

    You are on the right track with your second suggestion to put the internal IP on 192.168.0.x, but you guess wrong with regard to subnet masks. The short answer is just make the netmasks of both interfaces 255.255.255.0 (/24). The long answer is to read up on how the netmask influences the size of the subnet.

  10. #10
    Join Date
    Jun 2008
    Location
    Connecticut, USA
    Posts
    2,295
    Blog Entries
    1

    Default Re: Determine which eth card is internal/external

    Does the IP range supplied by the DHCP Server have to change to 192.168.0.xxx so the first 3 parts match between the IP's being passed out and the IP of the static internal eth card?

    192.168.0.1 to 99 = supplied IP addresses (via DHCP server)
    192.168.0.201 = router static internal IP
    192.168.1.254 = DSL Modem

    Thanks for your patience.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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