In short, is there a way to give a public ip to a specific device connected to the switch under openwrt?
My iptv stb needs public ip.
Currently, it is connected to the isp's 4-port hub, but this does not make the home network a single network.
isp hub assigns public ip to each of the 4 ports. I would like to replace this with my openwrt box and connect the switch at the bottom to make the home network one
now: WAN -> isp hub -> openwrt box (public ip1) -> AP (192.168.x.x)
------------------------------> other room1 (public ip2)
------------------------------> other room2 (public ip3)
------------------------------> iptv (public ip4)
I want: WAN -> openwrt box (public ip1) -> switch -> AP (192.168.x.x)
-------------------------------------------------------------------> other room1 (192.168.x.x)
-------------------------------------------------------------------> other room2 (192.168.x.x)
-------------------------------------------------------------------> iptv (public ip2)
There is only one port for lan, so it doesn't seem simple.
Is it possible to achieve this with vlan?
With vlans and a managed switch it would be possible.
One vlan will be for the private IPs and the other will be bridged with the wan interface to relay the public IP to the stb.
I set up vlan100 and vlan200 on the switch (to be precise, ap mode asus router).
port 1~3 / wifi is set to vlan100 and port 4 is set to vlan200, and I am trying to get the public IP through port4.
But I am not sure what next setting should be done in openwrt.
eth1 is wan and eth0 is lan.
eth0.100 was added for lan and works fine with private ip.
what is next?
I tried to bridge eth1 with eth0.200 but it didn't work.
eth1 also need to make vlan?
Do I need a tool like dhcp-forwarder?
I'm not sure how I can pass the client's dhcp request through the openwrt box to reach the isp dhcp server.
On OpenWrt side you need both eth0.100 (as lan) and eth0.200 (bridged to wan)
On the other side you need the interface which connects to OpenWrt to be trunk carrying vlan 100 and 200. Then the other ports can be access/untagged for each vlan you want.
This method can be used to get open nat (nat type 1) to xbox or ps4.
Various soho routers (asus, netgear, tp-link, etc) provide the function of obtaining a public IP by excluding a specific port from LAN.
Most of the data about openwrt was written about devices with built-in switches, and I couldn't find any useful articles available for x86.