Jump to content

Photo

What's the proper way to setup two very different networks with two netcards

- - - - -

No replies to this topic

#1
pascalbrax

pascalbrax

    Newbie

  • Members
  • Pip
  • 9 posts

I have installed two network cards on my system.

 

One card is connected to a switch, while the second card is connected to a bridged modem.

 

the configuration looks like this:

eth0 -> switch -> DLS modem -> internet

eth1 ->    bridge modem     -> internet

eth0 gets its IP (local) by the DSL modem, which acts as DHCP server for the whole LAN.

eth1 gets its IP (public, dynamic) from the ISP directly.

 

this is how route -n looks like:

pascal@mira ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         46.126.78.1     0.0.0.0         UG    202    0        0 eth1
46.126.78.0     0.0.0.0         255.255.254.0   U     202    0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
192.168.0.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 eth0

ifconfig:

pascal@mira ~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.39  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2002:5437:f2f1:0:beae:c5ff:fedf:385e  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::beae:c5ff:fedf:385e  prefixlen 64  scopeid 0x20<link>
        ether bc:ae:c5:df:38:5e  txqueuelen 1000  (Ethernet)
        RX packets 825473  bytes 77401388 (73.8 MiB)
        RX errors 0  dropped 79  overruns 0  frame 0
        TX packets 1433430  bytes 2117336429 (1.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.39  netmask 255.255.255.0  broadcast 192.168.0.255
        ether bc:ae:c5:df:38:5e  txqueuelen 1000  (Ethernet)

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 46.126.79.24  netmask 255.255.254.0  broadcast 255.255.255.255
        inet6 fe80::41d9:9455:2d1e:97f  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:21:0a:01  txqueuelen 1000  (Ethernet)
        RX packets 81227  bytes 4890805 (4.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2611  bytes 234196 (228.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 114266  bytes 67619893 (64.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 114266  bytes 67619893 (64.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

and inxi:

pascal@mira ~ $ inxi -n
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
           IF: eth1 state: up speed: 1000 Mbps duplex: full mac: 00:e0:4c:21:0a:01
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: bc:ae:c5:df:38:5e

pascal@mira ~ $ inxi -i
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
           IF: eth1 state: up speed: 1000 Mbps duplex: full mac: 00:e0:4c:21:0a:01
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: bc:ae:c5:df:38:5e
           WAN IP: 84.55.242.241
           IF: eth0 ip-v4: 192.168.0.39 ip-v6-link: fe80::beae:c5ff:fedf:385e
           IF: eth1 ip-v4: 46.126.79.24 ip-v6-link: fe80::41d9:9455:2d1e:97f

The problem is that the connection on eth1 seems very unreliable.

 

Sometimes it works, I can ping it from the internet, I can access apache hosts. Sometimes it simply doesn't respond, sometims inxi hangs at the IP part, sometimes it seems not working at all.

 

From inside the machine, now I can't even use the interface.

pascal@mira /var/www/comdox.ch/comuneparadiso/mundelibere/db $ curl ifconfig.co --interface eth0
my.public.ip.here
pascal@mira /var/www/comdox.ch/comuneparadiso/mundelibere/db $ curl ifconfig.co --interface eth1
curl: (7) Failed to connect to ifconfig.co port 80: Connection timed out




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users