The reason it's in port 2 right now is because i have it directly connected to my pc so i could actually access it.
When i put it in the WAN port directly to my PC, it doesn't give me an IP, which i hope is intended.
swconfig dev switch0 show:
root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
enable_vlan: 1
ports: 0x003f
Port 0:
pvid: 2
link: port:0 link:down
Port 1:
pvid: 1
link: port:1 link:down
Port 2:
pvid: 1
link: port:2 link:up speed:100baseT full-duplex auto
Port 3:
pvid: 1
link: port:3 link:down
Port 4:
pvid: 0
link: port:4 link:down
Port 5:
pvid: 0
link: port:5 link:up speed:100baseT full-duplex
VLAN 1:
ports: 1 2 3 5t
VLAN 2:
ports: 0 5t
root@OpenWrt:~#
If I understand what you are saying, when you connect the port on the OpenWrt router that you have configured as a WAN port, you do not get an IP address on your computer. This is the correct and expected behavior. Note which port this is -- and connect your ISP modem to this port.
Connect your computer to another port on the router (the others should be your LAN. Your computer should get a DHCP issued address from the OpenWrt router -- verify the address you get and post it here (it should be something in the 192.168.1.0/24 network).
In LuCI, the main status page should have a section for "IPv4 upstream" -- you should hopefully see a valid IPv4 address from the ISP in that section. Please verify that (bonus -- you can give us the first two octets which will help us validate that it is working as expected while not revealing your complete address).
Don't move the cable from that port to your PC.
Plug the cable from the ISP router to one port and run the same command. You'll see the port link:up. If it is not Port 0 try another port.
You can do the same in Luci Network/Switch. Once you plug in the cable you'll see the port coming up.
@trendy
Alright, i think everything is working as intended now.
I keep getting the right config from the DHCP consistently.
Windows client ipv4: 100.74.0.116(Preferred)
The OpenWrt's ip is 100.74.1.1 , as i set it to be that.
I can see on the main page that all devices get DHCP leases in the 100.74.0.0/17 range. Will decreasing the subnet mask help on performance or should i just leave it that big?
The /24 can accommodate 254 hosts, that is more than enough for a home subnet.
Technically you can use the 100.74.0.0/17. The address space 100.64.0.0/10 is reserved for cg-nat. But better stick to the 10.x.y.z addresses.
It's a highly recommended practice to use all lowercase for interface names. (LuCI converts them to uppercase for display; it really shouldn't). If you have 'WAN' in /etc/config/network and 'wan' as the network name in the firewall zone, it will not work.
Put the DNS servers in in the wan interface config block. When you are troubleshooting network problems, try to simplify the configuration as much as possible, for example use the ISP's DNS received by DHCP instead of specifying others.