# can someone explain :)



## Myron (Dec 9, 2009)

hey guys

my box has 2 nic card and i successfuly config the brigde mode and running fine but my question in manual handbook why need to include this? can someone explain clearly. 


```
cloned_interfaces="bridge0"
ifconfig_bridge0="addm fxp0 addm fxp1 up"
ifconfig_fxp0="up"
ifconfig_fxp1="up"
```
 
thanks


----------



## SirDice (Dec 9, 2009)

Because it doesn't work if you don't?

More seriously, what's the exact confusion? Why you need to add that to /etc/rc.conf? Or what those entries do?


----------



## Myron (Dec 9, 2009)

SirDice said:
			
		

> Because it doesn't work if you don't?
> 
> More seriously, what's the exact confusion? Why you need to add that to /etc/rc.conf? Or what those entries do?



holy cow i got this error sirdice after rebooting


```
/etc/rc.conf: 79: Syntax error: Unterminated quoted string
Enter full path name of shell or RETURN for /bin/sh:
```
 how to back in normal, pls help waaaaaaaa!!

thanks


----------



## SirDice (Dec 9, 2009)

```
fsck -y
mount -u /
mount -a -t ufs
swapon -a
```

Now edit /etc/rc.conf and fix the error.


----------



## Myron (Dec 9, 2009)

SirDice said:
			
		

> ```
> fsck -y
> mount -u /
> mount -a -t ufs
> ...



its ok now ^_^

thanks dude


----------



## idle (Dec 9, 2009)

Myron said:
			
		

> ```
> cloned_interfaces="bridge0"
> ifconfig_bridge0="addm fxp0 addm fxp1 up"
> ifconfig_fxp0="up"
> ...


The 4th string obviously redundant.

*SirDice*
Just mount -a would be enough here.


----------



## SirDice (Dec 9, 2009)

idle said:
			
		

> Just mount -a would be enough here.


Not if you boot in single user mode. Then / would be mounted read-only. Also mount -a will try to mount nfs and/or smbfs shares. That's not going to work as the network isn't running yet. So to prevent "weird" (for a newbie at least) error messages, mount -a -t ufs.


----------



## phoenix (Dec 9, 2009)

idle said:
			
		

> The 4th string obviously redundant.



No, it's not.

The "up" in the ifconfig_bridge line refers to bridge0.

The "up" in the ifconfig_fxp1 line refers to fxp1.

Without the last line, the fxp1 interface will not be brought up, and the bridge will fail.


----------



## Myron (Dec 11, 2009)

guys everytime i reboot the machine the bridge doesnt work what im gonna do? someone can help?

thanks


----------



## DutchDaemon (Dec 11, 2009)

Post the output of [cmd=]dmesg -a[/cmd] and of [cmd=]ifconfig -a[/cmd] here. Inside 
	
	



```
tags, please.
```


----------



## bschmidt (Dec 11, 2009)

And also explain what you are trying to achieve with the bridge anyway. Fallover? STP?


----------



## Myron (Dec 14, 2009)

actually this is my plan i want my bsd box as a transparent proxy and my ISP provide 2 static ip, i need to asign 1 public static for bsd box and 1 public static for my router something like this

ISP >>>>>>> FREEBSD (transparent proxy + public static ip >>>>>>> Mikrotik Router + public static ip.

can you guys give some idea what is best setup.

thanks and appreciate a lot

myron


----------



## idle (Dec 14, 2009)

There is no need to assign public ip to bridge, it's working without ip at all. For proxy private address(192.168.0.1) will be enough.
In the rest all seems correct.

*phoenix*
You're right, I have missed it.


----------



## Myron (Dec 14, 2009)

DutchDaemon said:
			
		

> Post the output of [cmd=]dmesg -a[/cmd] and of [cmd=]ifconfig -a[/cmd] here. Inside
> 
> 
> 
> ...


----------



## Myron (Dec 14, 2009)

```
atapci1: <Intel ICH7 SATA300 controller> port 0xd080-0xd087,0xd000-0xd003,0xcc00-0xcc07,0xc880-0xc883,0xc800-0xc80f irq 19 at device 31.2 on pci0
atapci1: [ITHREAD]
ata2: <ATA channel 0> on atapci1
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci1
ata3: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_button0: <Power Button> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio0: [FILTER]
cpu0: <ACPI CPU> on acpi0
ACPI Warning (tbutils-0243): Incorrect checksum in table [OEMB] -  9A, should be 95 [20070320]
est0: <Enhanced SpeedStep Frequency Control> on cpu0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
cpu1: <ACPI CPU> on acpi0
est1: <Enhanced SpeedStep Frequency Control> on cpu1
p4tcc1: <CPU Frequency Thermal Control> on cpu1
pmtimer0 on isa0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppbus0: <Parallel port bus> on ppc0
ppbus0: [ITHREAD]
plip0: <PLIP network interface> on ppbus0
plip0: WARNING: using obsoleted IFF_NEEDSGIANT flag
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ppc0: [GIANT-LOCKED]
ppc0: [ITHREAD]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounters tick every 1.000 msec
acd0: DVDR <SONY DVD RW DRU-840A/SS01> at ata0-master UDMA66
ad4: 238475MB <Seagate ST3250318AS CC37> at ata2-master SATA150
SMP: AP CPU #1 Launched!
GEOM_LABEL: Label for provider acd0 is iso9660/OpenBSD/i386    4.6 Install CD.
GEOM_LABEL: Label for provider ad4s1a is ufsid/4b25c7669befae29.
GEOM_LABEL: Label for provider ad4s1d is ufsid/4b25c76df71badc4.
GEOM_LABEL: Label for provider ad4s1e is ufsid/4b25c769362ae6f3.
GEOM_LABEL: Label for provider ad4s1f is ufsid/4b25c769fea47d61.
GEOM_LABEL: Label for provider ad4s1g is ufsid/4b25c7668274dfb0.
Trying to mount root from ufs:/dev/ad4s1a
Loading configuration files.
kernel dumps on /dev/ad4s1b
Entropy harvesting:
 interrupts
 ethernet
 point_to_point
 kickstart
.
swapon: adding /dev/ad4s1b as swap device
Starting file system checks:
GEOM_LABEL: Label ufsid/4b25c7669befae29 removed.
/dev/ad4s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad4s1a: clean, 180399 free (3223 frags, 22147 blocks, 1.3% fragmentation)
GEOM_LABEL: Label for provider ad4s1a is ufsid/4b25c7669befae29.
GEOM_LABEL: Label ufsid/4b25c7668274dfb0 removed.
/dev/ad4s1g: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad4s1g: clean, 51266569 free (17 frags, 6408319 blocks, 0.0% fragmentation)
GEOM_LABEL: Label for provider ad4s1g is ufsid/4b25c7668274dfb0.
GEOM_LABEL: Label ufsid/4b25c769362ae6f3 removed.
/dev/ad4s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad4s1e: clean, 253809 free (33 frags, 31722 blocks, 0.0% fragmentation)
GEOM_LABEL: Label for provider ad4s1e is ufsid/4b25c769362ae6f3.
GEOM_LABEL: Label ufsid/4b25c769fea47d61 removed.
/dev/ad4s1f: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad4s1f: clean, 64203338 free (19434 frags, 8022988 blocks, 0.0% fragmentation)
GEOM_LABEL: Label for provider ad4s1f is ufsid/4b25c769fea47d61.
GEOM_LABEL: Label ufsid/4b25c76df71badc4 removed.
/dev/ad4s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad4s1d: clean, 999278 free (102 frags, 124897 blocks, 0.0% fragmentation)
GEOM_LABEL: Label for provider ad4s1d is ufsid/4b25c76df71badc4.
GEOM_LABEL: Label ufsid/4b25c7669befae29 removed.
Setting hostuuid: 40551902-d6a9-dc11-95d3-001e8c74630e.
Setting hostid: 0xfaa7bce4.
Mounting local file systems:
GEOM_LABEL: Label ufsid/4b25c7668274dfb0 removed.
GEOM_LABEL: Label ufsid/4b25c769362ae6f3 removed.
GEOM_LABEL: Label ufsid/4b25c769fea47d61 removed.
GEOM_LABEL: Label ufsid/4b25c76df71badc4 removed.
.
Setting hostname: kamote.net.
net.inet6.ip6.auto_linklocal:
1
 ->
0

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
age0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=319b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC>
        ether 00:1e:8c:74:63:0e
        inet 10.11.0.8 netmask 0xffffff00 broadcast 10.11.0.255
        media: Ethernet autoselect (none)
        status: no carrier
add net default: gateway 10.11.0.1
Additional routing options:
 IP gateway=YES
.
Starting devd.
hw.acpi.cpu.cx_lowest:
C1
 ->
C1

Additional IP options:
.
Mounting NFS file systems:
.
Creating and/or trimming log files:
.
Starting syslogd.
Checking for core dump on /dev/ad4s1b...
savecore: no dumps found
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout
Initial i386 initialization:
.
Additional ABI support:
 linux
.
Clearing /tmp (X related).
Starting local daemons:
.
Updating motd
.
Mounting late file systems:
.
Configuring syscons:
 keymap
 blanktime
.
Starting sshd.
age0: link state changed to UP
Starting cron.
Local package initialization:
.
Starting background file system checks in 60 seconds.

Mon Dec 14 05:57:57 PHT 2009
Dec 14 05:58:04 kamote login: ROOT LOGIN (root) ON ttyv0
bridge0: Ethernet address: e2:1c:a8:a7:8a:38
age0: promiscuous mode enabled
rl0: promiscuous mode enabled
rl0: link state changed to DOWN
rl0: link state changed to UP
Dec 14 07:53:12 kamote login: ROOT LOGIN (root) ON ttyv0
kamote#
```


----------



## Myron (Dec 14, 2009)

```
kamote# ifconfig
age0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3019<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MCAST,WOL_MAGIC>
        ether 00:1e:8c:74:63:0e
        inet 10.11.0.8 netmask 0xffffff00 broadcast 10.11.0.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
rl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 00:1d:0f:c1:a4:bb
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether e2:1c:a8:a7:8a:38
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: rl0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 2 priority 128 path cost 55
        member: age0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 200000
kamote#
```

everytime the box rebooted the bridge doesnt work


----------



## malexe (Dec 14, 2009)

what do you do to make it work? it should give you hints to what needs to be configured correctly


----------



## Myron (Dec 17, 2009)

guys my bridge is now working and fine even i reboot the machine but i have another problem again  (router >>> fbsd >>> client)
my laptop is behind of fbsd box and if i ping use my laptop  can ping outside host but if im in fbsd box and ping outside host is unreachable, did i missed something with my setup? before without bridging i can ping the age0 IP but now after the bridge is properly configure in ifconfig age0(onboard NIC) it shows no ip but running

thanks


----------



## bschmidt (Dec 19, 2009)

Is the `# ifconfig` output posted about still correct? If so, you probably have to give the bridge interface the IP address, not the age0 interface.


----------

