[linux] voorlopig laatste vraag: netwerk.

Daniel C. von Asmuth asmuth op bakunin.xs4all.nl
Do Sep 15 21:07:07 CEST 2016


Aldus schreef paai op Thu, Sep 15, 2016 at 07:46:06PM +0200:
> In mijn server zitten twee NICs. Ik wil met de tweede NIC een netwerkprinter
> aansturen op 192.168.178.100. Echter: ik kan hem niet pingen.
> 
> 
> Mijn rc.local bevat de volgende regels:
> 
Hebt u die er zelf ingezet?  De meeste distributies hebben een iets
andere manier om het netwerk te configureren. Meestal is het netwerk
al up & running voordat een shell met /etc/local wordt uitgevoerd. 

> # opzetten bridge voor printer achter de server
> 
> /sbin/brctl addbr br0
> /sbin/brctl stp br0 on
> 
> /sbin/ifconfig enp2s0 0.0.0.0 down
> /sbin/ifconfig enp4s8 0.0.0.0 down
> 
> /sbin/brctl addif br0 enp2s0
> /sbin/brctl addif br0 enp4s8
> 
> /sbin/ifconfig enp2s0 up
> /sbin/ifconfig enp4s8 up
> /sbin/ifconfig br0 192.168.178.25 up
> 
> /sbin/route add default gw 192.168.178.1

Eerlijk gezegd heb ik geen ervaring met bridges. Moeten die interfaces 
eerst down worden gebracht alvorens ze aan de bridge worden toegevoegd? 
Moet de bridge zelf down zijn? 
 
> # ifconfig 192.168.178.25 up
> 
> echo "1" > /proc/sys/net/ipv4/ip_forward
> 
> In de dmesg staat niets alarmerends. De ifconfig ziet er als volgt uit:
> 
> 
> $ ifconfig
> br0       Link encap:Ethernet  HWaddr 00:10:4b:77:91:10
>           inet addr:192.168.178.25  Bcast:192.168.178.255 Mask:255.255.255.0
>           inet6 addr: fe80::210:4bff:fe77:9110/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:13368 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:21163 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:4863000 (4.8 MB)  TX bytes:14578827 (14.5 MB)
> 
> enp2s0    Link encap:Ethernet  HWaddr 00:24:e8:3e:5c:3d
>           inet6 addr: fe80::224:e8ff:fe3e:5c3d/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:13508 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:21506 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:5145166 (5.1 MB)  TX bytes:14688399 (14.6 MB)
>           Interrupt:16
> 
> enp4s8    Link encap:Ethernet  HWaddr 00:10:4b:77:91:10
>           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:0xc000
> 
> 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:65536  Metric:1
>           RX packets:761 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:761 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1
>           RX bytes:57803 (57.8 KB)  TX bytes:57803 (57.8 KB)

ifconfig zegt niet zoveel, behalve dat interface enp4s8 wel 'up', maar 
niet 'running' is. 

Op mijn ADSL modem lijkt het commando 'brctl show' te zeggen dat alle 
Ethernet poorten in hetzelfde netwerk zitten. 

# brctl show
bridge name     bridge id               STP enabled     interfaces
lan             8000.246511b42d37       no              eth0
                                                        eth1
                                                        eth2
                                                        eth3
guest           8000.246511b42d37       no
hotspot         8000.246511b42d37       no


Suc6,



Daniel

-- 
	
		Beware of logic, for it leads to paradox. 
		Steer clear of paradoxes, for they defeat logic. 


More information about the Linux mailing list