Keep getting isp routers gateway on client PC

Hi all, first post so i am sorry if im not posting enough info.

As the title suggests i have a stable internet connection but my gateway is still set to the ISP router for some reason.

This is the network config:

I have OpenWrt on a WN2500RP netgear router.
My isp router is an ICOTERA i6801-10

Visualized LAN: WAN > ISP Router > OpenWrt router > Unmanaged switch > unmanaged switch > Client PC.

This doesn't look correct at all. There is no wan interface. Lan is bridging eth0.1 with eth0 and using gateway outside of the subnet.
Most likely your PCs just get DHCP from ISP router directly rather than from the OpenWrt DHCP.
Reset the device and read here how to make the device a router.

2 Likes

Thank you for sending this link. I admit that i am a network noob. I will try this out and mark this the solution if it works.

1 Like

Alright i followed the link.

I reset the openwrt router.
Then i made a second VLAN, and put PORT 4 in untagged.
Then i edited the br-lan interface to use "eth0.2"
Then when i went to my console and typed "ipconfig /renew" it said : "unable to contact your DHCP server. Request has timed out."

On another note, i am also quite confused on what my openwrt's gateway should be. Should it be my WAN ip or the isp router ipv4? so far i just left it unedited and just followed the link

Please post the output of the following commands. Remember to redact passwords, MAC adresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Additionally, if you would post the default files, that would help. Those are located in the ROM partition:

cat /rom/etc/config/network
cat /rom/etc/config/wireless
cat /rom/etc/config/dhcp
cat /rom/etc/config/firewall

Alright, got em. There was no wireless as i don't need it nor is it supported without further modification.

As a new user i can't post more than one pic so i hosted them on prnt.sc

/rom/etc/config/network, wasn't there neither.

/etc/config/network:
https://prnt.sc/s8s7jd


/etc/config/firewall:

root@OpenWrt:/etc/config# cat firewall
config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option src_ip           fc00::/6
        option dest_ip          fc00::/6
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80::/10
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT

# include a file with users custom iptables rules
config include
        option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  **REDACTED**
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  **REDACTED**
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  **REDACTED**
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp

config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

/etc/config/dhcp:
https://prnt.sc/s8s87v


/rom/etc/config/firewall:

root@OpenWrt:/rom/etc/config# cat firewall
config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option src_ip           fc00::/6
        option dest_ip          fc00::/6
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80::/10
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT

# include a file with users custom iptables rules
config include
        option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  **REDACTED**
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#      option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  **REDACTED**
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  **REDACTED**
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp

/rom/etc/config/dhcp:

I'm sorry, I should have given a bit more direction... would you mind editing your post to make it more readable:

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

Thank you, that looks much better.

I hope it is okay that the screenshots are still there.
If not i have to disconnect the router and direct connect it to my pc so i can ssh in again.

You need to create now the wan interface.
You can do it from Luci Network-Interfaces-Add. Give name wan, protocol dhcp, and select physical interface eth0.2. After that go to firewall and set the firewall zone to wan for it.
Now connect the lan4 port (which is now wan) to the lan port of the router of the ISP and your devices on the other 3 lan ports.

Alright, so i created an interface called "WAN".
I then set the protocol to "DHCP Client".
I then set the Interface to "eth0.2".
then i went to firewall settings, in the interface settings, on the "WAN" interface and put WAN in it.

I still get my ISP's DNS suffix and default gateway.

Do i need to bridge interfaces?

Where is that happening? On OpenWrt? On a PC connected to the OpenWrt?

No.
What is the output of ifstatus wan on OpenWrt and ipconfig /all on a windows host or ip -4 addr; ip -4 ro on a linux host?

It is on a windows client.

Windows Host:

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . : bbsyd.net
   Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller #2
   Physical Address. . . . . . . . . : **REDACTED**
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : fd39:af24:529d::de6(Preferred)
   Lease Obtained. . . . . . . . . . : 30 April 2020 18:13:28
   Lease Expires . . . . . . . . . . : 08 June 2156 21:07:40
   IPv6 Address. . . . . . . . . . . : fd39:af24:529d:0:452:45a4:7d18:58cc(Preferred)
   IPv6 Address. . . . . . . . . . . : fd60:47da:3941::de6(Preferred)
   Lease Obtained. . . . . . . . . . : 30 April 2020 14:41:35
   Lease Expires . . . . . . . . . . : 08 June 2156 21:07:40
   Temporary IPv6 Address. . . . . . : fd39:af24:529d:0:15cf:d53d:fe29:bb33(Preferred)
   Temporary IPv6 Address. . . . . . : fd39:af24:529d:0:fc4a:e5eb:c81b:7100(Deprecated)
   Link-local IPv6 Address . . . . . : fe80::452:45a4:7d18:58cc%24(Preferred)
   IPv4 Address. . . . . . . . . . . : 100.74.11.226(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.128.0
   Lease Obtained. . . . . . . . . . : 02 May 2020 13:56:11
   Lease Expires . . . . . . . . . . : 02 May 2020 19:58:38
   Default Gateway . . . . . . . . . : 100.74.0.1
   DHCP Server . . . . . . . . . . . : 178.132.230.5
   DHCPv6 IAID . . . . . . . . . . . : **REDACTED**
   DHCPv6 Client DUID. . . . . . . . : **REDACTED**
   DNS Servers . . . . . . . . . . . : fd39:af24:529d::1
                                       212.10.10.4
                                       212.10.10.5
                                       fd39:af24:529d::1
   NetBIOS over Tcpip. . . . . . . . : Enabled

ifstatus WAN:

root@OpenWrt:~# ifstatus WAN
{
        "up": false,
        "pending": true,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "proto": "dhcp",
        "device": "eth0.2",
        "data": {

        }
}
root@OpenWrt:~#

It is supposed to be "up": true , right?

UPDATE:
I found out that it worked on another windows client connected to the same switch.
So i fired up CMD on my main windows client on the same switch and ran ipconfig /renew.
It couldn't contact the DHCP.
I then restarted and i got the right gateway and the openwrt dns suffix: "lan"
So i think it works as it should now. Does this sound right? I mean, could a restart really fix that?
I can't ping the other client. The request timed out.

No it doesn't sound right. It looks like you have connected the ISP router to a LAN port on the OpenWrt, instead of the WAN port. That is why you get dhcp settings from OpenWrt and the ISP router, as well as the wan in ifstatus is reported as "up": false.

1 Like

It is worth remembering that the physical port numbers on the enclosure may not (and often does not) match the logical port numbers in the configuration. The port numbers in OpenWrt represent the numbers inside the switch chip, which may or may not be mapped in physical order on the ports and case markings.

Quick test: disconnect everything from the router. Plug in one computer via Ethernet to one of the ports. Does the computer get a dhcp issued op address? If yes, it is a lan port (as configured). Move on to the next port and so on. When you don’t get an address, that is the configured wan port.

You can also use the link status indicators in openwrt to show which logical ports are up/down and correlate them to the numbers makes on the case.

Huh!?!?

This exists by default (and is lowercase in the default config)...are you erasing the original network config file after reset of the device?

BTW, welcome to the community, @ConfusedUser.

The device is a 4 lan port repeater without wan, hence the absence of wan interface in the default config.

2 Likes

OK, an even better question then...when did the OP actually note that they declared a switch port as Access to VLAN 2?

EDIT: I see the pic of the updated config.

1 Like

Supposedly here.
Or here

1 Like

Go to the network--switch page and confirm your VLAN configuration. Unplug the cable to the modem and observe the icon change from connected to disconnected. The modem must be on the port that you set into VLAN 2. Often the port numbering on the box does not correspond to the software numbers in the switch.

3 Likes