Assign an IP address to a bridge fail
Pierre Dupond
76nemo76 at gmx.ch
Mon Jul 22 08:50:22 UTC 2019
Hi,
Thanks for the tip. I have slightly modified
the file "/etc/rc.conf" and now the network is setup correctly. You have to
note that the command "inet 172.16.0.11" (in the variable
"ifconfig_bridge0")
should appear first otherwise the address is not set.
By the way, since there is 4 igb cards on this machine, it seems to be a
good
idea to add this instruction: kern.ipc.nmbclusters="131072" in the file
"/boot/loader.conf"
as it is mentioned in the man page of the "igb" driver and in this link:
https://docs.netgate.com/pfsense/en/latest/hardware/tuning-and-troubleshooting-network-cards.html
best regards,
-----------------------------------------------Functioning file
rc.conf-----------------------------------------------------------
#The configuration of the network. The four
#network cards of the APU are used here as a unique bridge.
#
#Since this machine is often used as a server,
#having a bridge can avoid to cable an external
#switch to connect to it some other net devices.
cloned_interfaces="bridge0"
ifconfig_igb0="up"
ifconfig_igb1="up"
ifconfig_igb2="up"
ifconfig_igb3="up"
#Only one variable "ifconfig_bridge0" should be defined
#and the address specification should be the first parameter.
#With this solution the bridge is correctly configured at boot,
#otherwise some strange and wrong things happen and the network
#does not work.
ifconfig_bridge0="inet 192.168.1.11/23 addm igb0 addm igb1 addm igb2
addm igb3 up"
defaultrouter="192.168.1.1"
#To have all the interfaces (present and future, for instance
#when dynamically created) with the IPv6 capability
ipv6_activate_all_interfaces="YES"
#
#Force the creation of temporary IPv6 address. Complicate
#tracing
ipv6_privacy="YES"
#All the network prefixes used on this interface.
ipv6_prefix_bridge0="2000:0:0:0 fd:0:0:0"
#Prefer IPv6 address when possible by using rules
#described in RFC 6724.
ip6addrctl_enable="ipv6_prefer"
ifconfig_bridge0_ipv6="inet6 fd::2 prefixlen 64"
ifconfig_bridge0_alias0="inet6 2000::2 prefixlen 64"
ipv6_defaultrouter="fd0::1"
#
#Reste de la config
#------------------
#
clear_tmp_enable="YES"
hostname="oche.local.sourire.ch"
sshd_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
Le 21/07/2019 à 23:16, Kamila Součková a écrit :
>
>
> On Sun, 21 Jul 2019, 20:30 Pierre Dupond, <76nemo76 at gmx.ch
> <mailto:76nemo76 at gmx.ch>> wrote:
>
> Hi all,
>
> I am facing a strange problem. Just after installing a fresh
>
> Freebsd 12 on an Pc Engines APU machine, I build a bridge with the 4
>
> network cards.
>
>
> If I try to setup the address of the bridge in the "/etc/rc.conf"
> file,
> I can not ping (outside the address
>
> given to the bridge). But if I comment the line for setting the
> address
> in the file
>
> "/etc/rc.conf" and I set the address manually with the command
>
> "ifconfig bridge0 inet 172.16.0.11 netmask 255.255.254.0" the ping
> works.
>
> Do I have made an obvious mistake in the "rc.conf" file? What could be
> the reason of this problem?
>
> Any ideas would be greatly appreciated.
>
>
> best regards,
>
>
> ----------------------------------Content of the rc.conf
> file----------------------------------------------------------
> root at oche:~ # cat /tmp/rc.conf
> cat: /tmp/rc.conf: No such file or directory
> root at oche:~ # cat /etc/rc.conf
> cloned_interfaces="bridge0"
> ifconfig_bridge0="addm igb0 addm igb1 addm igb2 addm igb3 up"
> ifconfig_igb0="up"
> ifconfig_igb1="up"
> ifconfig_igb2="up"
> ifconfig_igb3="up"
> ifconfig_bridge0="inet 172.16.0.11 netmask 255.255.254.0"
> defaultrouter="172.16.0.10"
> #
> #Reste de la config
> #------------------
> #
> clear_tmp_enable="YES"
> hostname="oche.local.sourire.ch <http://oche.local.sourire.ch>"
> sshd_enable="YES"
> ntpdate_enable="YES"
> ntpd_enable="YES"
> powerd_enable="YES"
> # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
> dumpdev="AUTO"
>
> -----------------------------------------------Info about the
> bridge and
> ping commands
>
> bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric
> 0 mtu
> 1500
> ether 02:91:bc:80:6d:00
> inet 172.16.0.11 netmask 0xfffffe00 broadcast 172.16.1.255
> id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
> maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
> root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
> groups: bridge
> nd6 options=9<PERFORMNUD,IFDISABLED>
> root at oche:~ # ping 172.16.0.11
> PING 172.16.0.11 (172.16.0.11): 56 data bytes
> 64 bytes from 172.16.0.11 <http://172.16.0.11>: icmp_seq=0 ttl=64
> time=0.221 ms
> 64 bytes from 172.16.0.11 <http://172.16.0.11>: icmp_seq=1 ttl=64
> time=0.202 ms
> 64 bytes from 172.16.0.11 <http://172.16.0.11>: icmp_seq=2 ttl=64
> time=0.203 ms
> ^C
> --- 172.16.0.11 ping statistics ---
> 3 packets transmitted, 3 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev = 0.202/0.209/0.221/0.009 ms
> root at oche:~ # ping 172.16.0.10
> PING 172.16.0.10 (172.16.0.10): 56 data bytes
> ping: sendto: Host is down
> ping: sendto: Host is down
> ping: sendto: Host is down
> ping: sendto: Host is down
> ^C
> --- 172.16.0.10 ping statistics ---
> 4 packets transmitted, 0 packets received, 100.0% packet loss
>
>
> You're redefining ifconfig_bridge0 in your rc.conf (you have it there
> twice).
>
> Also, there were some issues with bridge config in rc.conf, but I
> don't recall the details. In any case, not having ifconfig_bridge0
> twice is a good start.
>
> Best,
> Kamila
> (sent from my phone)
>
More information about the freebsd-questions
mailing list