LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2015, 07:38 AM   #1
Ruhpolding
LQ Newbie
 
Registered: Mar 2015
Location: Ruhpolding, Bavaria, Germany
Posts: 5

Rep: Reputation: Disabled
Connecting network printer via secondary ethernet card


There are two ethernet adapters on my system:

Code:
$lspci | grep Ethernet
00:13.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0c.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 30)
The first one is located on the main board and connects the router. The second one is a PCI card which will be connected to a Brother HL-5350DN network printer by a crossed ethernet cable.

Content of /etc/network/interfaces:

Code:
# Loopback
auto lo
iface lo inet loopback

# Router
auto eth0
iface eth0 inet dhcp

# Printer
auto eth1
iface eth1 inet static
      address 192.168.2.5
      netmask 255.255.255.0
Unfortunately, the host 192.168.2.5 acts just like a loopback device. Even when no cable is fitted into the eth1 adapter I get the following result:

Code:
$ ping 192.168.2.5
PING 192.168.2.5 (192.168.2.5) 56(84) bytes of data.
64 bytes from 192.168.2.5: icmp_req=1 ttl=64 time=0.041 ms
64 bytes from 192.168.2.5: icmp_req=2 ttl=64 time=0.041 ms
64 bytes from 192.168.2.5: icmp_req=3 ttl=64 time=0.039 ms
There is no traffic on the device eth1 indeed:

Code:
$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:41:86:85:81:0c  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11197 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10582 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9570615 (9.1 MiB)  TX bytes:1164352 (1.1 MiB)
          Interrupt:18 

eth1      Link encap:Ethernet  HWaddr 00:01:20:9a:c7:b2  
          inet addr:192.168.2.5  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Base address:0xe000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:220 errors:0 dropped:0 overruns:0 frame:0
          TX packets:220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:18316 (17.8 KiB)  TX bytes:18316 (17.8 KiB)
Please tell me, what is wrong with this configuration?
 
Old 03-08-2015, 08:10 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,924

Rep: Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999
Welcome to LinuxQuestions

Looks ok to me. Being able to ping yourself is normal.

Is the printer connected and its network configured? Can you ping the printer?
 
1 members found this post helpful.
Old 03-08-2015, 03:03 PM   #3
Ruhpolding
LQ Newbie
 
Registered: Mar 2015
Location: Ruhpolding, Bavaria, Germany
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for your assessment.

It doesn't matter whether the cable is plugged in or not. This ping command runs always on the loopback. And other things like "telnet 192.168.2.5" or browsing http://192.168.2.5/ don't go out of the system either.

Nevertheless, the connection to the printer seems to work (full-duplex is detected). Only the ntpd daemon causes some traffic on the eth1 device, surprisingly.

With
Code:
ifup --no-scripts -v eth1
Configuring interface eth1=eth1 (inet)
ip addr add 192.168.2.5/255.255.255.0 broadcast 192.168.2.255 dev eth1 label eth1
ip link set dev eth1 up
the system console shows the following messages:

Code:
Mar  8 20:51:02 machine avahi-daemon[2453]: Joining mDNS multicast group on interface eth1.IPv4 with address 192.168.2.5.
Mar  8 20:51:02 machine kernel: [  517.796749] eth1:  setting full-duplex.
Mar  8 20:51:02 machine avahi-daemon[2453]: New relevant interface eth1.IPv4 for mDNS.
Mar  8 20:51:02 machine avahi-daemon[2453]: Registering new address record for 192.168.2.5 on eth1.IPv4.
Mar  8 20:51:03 machine avahi-daemon[2453]: Joining mDNS multicast group on interface eth1.IPv6 with address fe80::201:2df:fe9c:a7b2.
Mar  8 20:51:03 machine avahi-daemon[2453]: New relevant interface eth1.IPv6 for mDNS.
Mar  8 20:51:03 machine avahi-daemon[2453]: Registering new address record for fe80::201:2df:fe9c:a7b2 on eth1.*.
Mar  8 20:51:05 machine ntpd[3237]: Listen normally on 12 eth1 192.168.2.5 UDP 123
Mar  8 20:51:05 machine ntpd[3237]: Listen normally on 13 eth1 fe80::201:2df:fe9c:a7b2 UDP 123
Mar  8 20:51:05 machine ntpd[3237]: peers refreshed
 
Old 03-08-2015, 06:22 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,924

Rep: Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999
ntp is configured to listen on all interfaces. Not really a problem.
 
Old 03-09-2015, 12:18 PM   #5
Ruhpolding
LQ Newbie
 
Registered: Mar 2015
Location: Ruhpolding, Bavaria, Germany
Posts: 5

Original Poster
Rep: Reputation: Disabled
Now, I have managed to talk to the printer (via telnet and http). For this purpose, /etc/network/interfaces has been reduced to

Code:
# Loopback
auto lo
iface lo inet loopback

# Printer
auto eth1
iface eth1 inet static
        address 10.12.220.100
        netmask 255.255.255.0
        gateway 10.12.220.201
The printer is configured to have the IP address 10.12.220.201 (I got the information by printing the printer settings).

Unfortunately, this configuration does not include the internet connection any longer. Therefor I would have to append

Code:
# Router
auto eth0
iface eth0 inet dhcp
to /etc/network/interfaces. This implies that for eth0 a gateway is defined as well. However, more than one gateway is not allowed and complained by ifup(8) with the cryptic error message "RTNETLINK answers: File exists".

How can I create an entry for eth1 without including any gateway statement?
 
Old 03-09-2015, 03:02 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,924

Rep: Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999Reputation: 5999
Do not specify a gateway for eth1
 
1 members found this post helpful.
Old 03-09-2015, 03:58 PM   #7
Ruhpolding
LQ Newbie
 
Registered: Mar 2015
Location: Ruhpolding, Bavaria, Germany
Posts: 5

Original Poster
Rep: Reputation: Disabled
Smile

Using at first two different private networks for the computer and the printer led into this dead end which I could leave now with your help. Many thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I Prevent an ethernet card from losing secondary IPs on Fedora 10 w/Shorewall? ftgnome Linux - Newbie 4 09-27-2010 02:33 PM
Dual Ethernet nic only connecting to 1 network at a time mrsnort27 Linux - Networking 1 05-11-2010 12:39 AM
Routing ports to secondary network card vockleya Linux - Networking 24 01-22-2010 08:08 PM
connecting to a network printer MT_Keg Linux - Newbie 1 10-28-2009 03:29 PM
PCMCIA ethernet card not connecting under Suse 9.1 rollo Linux - Networking 3 07-07-2004 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration