0

I have a single board computer running OpenWRT. The computer has two network interfaces:
eth0 - ethernet RJ45 jack
wwan0 - attached wireless card

I have an IP camera plugged into the eth0 (the RJ45 jack). wwan0 is connected to the internet. The camera is configured to send its data to some specific ip address out in the world, so I set up a bridge. The idea is that the video stream coming into eth0 will be redirected straight out wwan0 and out into the internet.

brctl addbr br0        #create the bridge
brctl addif br0 wwan0  #add wwan0 interface
udhcpc -i br0          #dhcp the bridge - have to do this before adding eth0
brctl addif br0 eth0   #add eth0 to bridge
ifconfig br0 up

And here's the result of ifconfig:

br0       Link encap:Ethernet  HWaddr 00:D0:12:0F:F1:4F  
          inet addr:100.64.186.196  Bcast:100.64.186.199  Mask:255.255.255.248
          inet6 addr: fe80::2496:ebff:fe88:58a1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1508 (1.4 KiB)  TX bytes:2416 (2.3 KiB)

eth0      Link encap:Ethernet  HWaddr 00:D0:12:0F:F1:4F  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:170 errors:0 dropped:0 overruns:0 frame:0
          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11782 (11.5 KiB)  TX bytes:25432 (24.8 KiB)


wwan0     Link encap:Ethernet  HWaddr 26:96:EB:88:58:A1  
          inet addr:100.64.186.196  Bcast:100.64.186.199  Mask:255.255.255.248
          inet6 addr: 2600:1011:b161:25af:34dc:4dd1:cc08:14a2/128 Scope:Global
          inet6 addr: fe80::2496:ebff:fe88:58a1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:254 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:16145 (15.7 KiB)  TX bytes:25802 (25.1 KiB)

When I set up the IP camera, I'm giving it just an arbitrary static IP, say 192.168.1.100. But it asks for a gateway address, which it is defaulting to 192.168.1.1. In this context what would be the appropriate gateway address? Obviously there's no 192.168.1.1 anywhere. Do I need to assign 192.168.1.1 to eth0 so the camera has a "gateway" to send its data to?

0

No, you can't give it just an arbitrary IP address. I see you have a public /29 subnet, i.e. addresses of the range 100.64.186.193 to 100.64.186.198, of which .196 is taken by wwan0. You should be able to choose, for example, 100.64.186.193 for the camera. The gateway should be the gateway the single board computer uses, which you can see with ip route.

How does the computer get its address? If via DHCP, I'd recommend to use that for the camera too, if the camera supports it.

Another alternative is to put the camera behind NAT. See the OpenWRT documentation for how to set up that.

  • That public address actually comes from Verizon on a cellular network. I image it could change at any time. Probably not a good idea to set the camera to an address in that range, right? – Dan Laks Dec 13 '16 at 8:00
  • No, definitely not as a static address. NAT might be your best option here. – Johan Myréen Dec 13 '16 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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