-3

I've Sangoma Linux 7.5.1805

I installed a second ethernet card into motherboardls and since then the integrated interface stopped working

As I plug cable into the second NIC the network starts to work again.

ifconfig shows me 2 interface eth0 and eth1

I even have 2 ifcfg files /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
ONBOOT='yes'
IPADDR=19.2168.16.98
NETMASK=255.255.255.0
GATEWAY=192.168.16.2
DESCRIPTION="unset"
TYPE=Ethernet
ZONE=trusted
PEERDNS=no
IPV6_PEERDNS=no

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
ONBOOT='yes'
IPADDR=19.2168.16.216
NETMASK=255.255.255.0
GATEWAY=192.168.16.2
ZONE=trusted
TYPE=Ethernet
PEERDNS=no
IPV6_PEERDNS=no

ipconfig ipconfig is

I also can ping the 192.168.16.98 from another computer

lspci -vv | grep net

enter image description here

How can I make both cards work?

arpa
  • 101
  • 1
  • 1
    Why do you need two interfaces on the same network? – Johan Myréen Jul 22 '19 at 16:58
  • I want to use second interface on another subnet but first I wanted to make sure the both cards are working properly – arpa Jul 22 '19 at 16:59
  • 1
    You can normally have only one default route, and probably the routing table is trying to use the disconnected interface. Have you tried turning the machine off and on again between the two tests? I'd recommend you to try the final configuration (separate subnets). – Johan Myréen Jul 22 '19 at 17:04
  • Please copy the command output  and paste it into your question as text. – Scott - Слава Україні Jul 22 '19 at 17:57
  • 2
    It's not easy to make two interfaces on the same network work correctly. If you want to make sure both are working properly, first connect up one, and then the other, but never both at the same time. – dirkt Jul 22 '19 at 20:06
  • @JohanMyréen Yes I tried this multiple times – arpa Jul 23 '19 at 03:13
  • @dirkt I am going to have a bad time if I try to connect a network card into pci-express socket when a computer is working :-) – arpa Jul 23 '19 at 03:16
  • 1
    No, you don't put the *card* in the *pci-express socket* one after another (and even if you had to do that, turning off the computer in between wouldn't be that hard). You put *both* cards in, and then first connect *one* card with an Ethernet cable to the router, then the *other* one, but not *both*. – dirkt Jul 23 '19 at 03:25
  • @dirkt I did exactly what you said but the first integrated network card doesn't work anyway – arpa Jul 23 '19 at 15:29

1 Answers1

0

I made it!

Eth1 - is the integrated network card - DEFROUTE=yes

Eth0 - is the new network card - DEFROUTE=no

Every card has it's own ifcfg-interfacename file

/etc/sysconfig/network-scripts/ifcfg-eth0

# FreePBX Sysadmin Generated network configuration.
# This file was generated at 2019-06-28T11:50:20+00:00
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.112.164.6
GATEWAY=10.112.164.1
TYPE=Ethernet
ZONE=trusted
PEERDNS=no
IPV6_PEERDNS=no
DEFROUTE=no
HWADDR=50:3E:AA:08:6B:84
DNS1=8.8.8.8
DNS2=4.4.4.4

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.16.98
NETMASK=255.255.255.0
GATEWAY=192.168.16.2
ZONE=internal
TYPE=Ethernet
PEERDNS=no
IPV6_PEERDNS=no
DEFROUTE=yes
HWADDR=04:92:26:5D:E7:A2
DNS1=8.8.8.8
DNS2=4.4.4.4

I found out HWADDR(I don't really know if it helped) using ip li

ip li

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether **50:3e:aa:08:6b:84 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether **04:92:26:5d:e7:a2** brd ff:ff:ff:ff:ff:ff

Specifying the only one default route using DEFROUTE was really important

arpa
  • 101
  • 1
  • Far more important was the specification of two different networks. You can go further now: https://unix.stackexchange.com/questions/200188/separate-network-traffic-on-two-network-interfaces – Christopher Jul 23 '19 at 17:50