[Solved] Dedicated IP from IPS with OpenWrt

Apologies for the noob question but been struggling with this issue for the past few days since we moved in to a new office with a new provider. In our last place, we had been using a dynamic IP so OpenWrt worked out of the box and the new guy who came to configure everything here could not figure out how to do this on OpenWrt. In the end he just gave me an IP address, Gateway, Netmask and two DNS addresses that I should be using if I'm going to try this on my own.

I can confirm that the details above work because I figured it out on how to connect the modem directly to a PCs ethernet port and get connectivity.

Config:

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd6d:597b:276d::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ifname 'eth0.2 eth1.1'

config interface 'wan'
	option proto 'static'
	option netmask '255.255.255.252'
	option gateway 'xxx.xx.xx.xx'
	option ifname 'eth0.2'
	option dns '8.8.8.8'
	option ipaddr 'xxx.xx.xx.xx'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '2 3 4 5 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 6t'

Any help appreciated!

This looks wrong to me, eth0.2 is assigned to both wan and lan interfaces, it seems someone tried random things to make it work. If I read your switch setup correctly, the ifname for your lan interface should be "eth0.1" (instead of "eth0.2 eth1.1"). Edit: I'll happily stand corrected.

1 Like

I think the eth1.1 is correct. Vlans 1 and 2 are on different CPU.
Moreover if that was wrong it would not be possible to access the router.
So first step is to remove eth0.2 from ifname of lan interface. Then it should work with defaults.

1 Like

trendy had the answer. Thanks to both for the help and hopefully this thread comes to use to others in the future.

Now for optimisation.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.