Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a USB-to-ETHERNET adapter (CP-USB-RJ45M) with which I am trying to create an ethernet bridge in CentOS Linux for ip-forwarding within a private LAN test network. I modified my /etc/rc.local file to create the bridge upon startup as follows:

/sbin/ifconfig eth0 0.0.0.0 up
/sbin/ifconfig eth2 0.0.0.0 up
/usr/sbin/brctl addbr link3_br
/usr/sbin/brctl addif eth0
/usr/sbin/brctl addif eth2
/sbin/ifconfig link3_br up

However, the USB-to-ETHERNET interface (eth2) will not enable. I have no IP address assigned to it, while eth1 has a statically defined IP and mask. Am I doing something wrong? I need to figure out how to get the bridge up and running so that ip-forwarding can occur. Please let me know if more details are required and I'll add to my question.

Edit: My original setup consisted of a server with 2 NICs where the ethernet interfaces have been successfully bridged. Each of those 2 ethernet connections goes to a different router. I am now trying to move those ethernet connections to a laptop where I connect one cable to the built-in ethernet port and the other one to my USB-to-ETHERNET adapter. In Wireshark, I can see OSPF DBDESC packets with the original server which works properly. When I connect the cables to my laptop, I only see OSPF hello messages.

share|improve this question

migrated from networkengineering.stackexchange.com Jan 3 at 16:58

This question came from our site for network engineers.

    
This is for a research environment I'm constructing at work. Why would that matter? –  THE DOCTOR Jan 3 at 16:49
    
so we know where to migrate –  Mike Pennington Jan 3 at 16:58
    
My most recent firewall box used a USB->etc adapter and we set it up with webmin. Maybe you could employ that then try to learn the why of the setup from the easier path? I'd answer you question with actual detail but that box's HDD literally died yesterday. It's replacement is a dual-NIC motherboard. –  Chris K Jan 6 at 11:37

1 Answer 1

I'll assume you ment brctl addif link3_br eth0 (and eth2.)

Bridging requires two things: changing the mac, and promiscuous mode. If the USB adapter refuses either (likely the latter), then it won't work. You could add the USB interface first so it'll use it's MAC, but that may not fix anything. Look at dmesg output to see if the kernel is logging a reason for the failure.

share|improve this answer
    
You are correct, that was a silly typo. I tried adding the USB interface first, but it didn't make any difference. When I looked at the dmesg output, I didn't see anything peculiar. –  THE DOCTOR Jan 3 at 22:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.