Help connection two routers using ethernet cable

i want two connect two openwrt routers using ethernet cables but when i do it i can't access to the second router even if i set two different ip addresses for them 192.168.1.1 / 192.168.2.2

HELP PLIZ

How are you connecting the two routers?

  • LAN to LAN
  • WAN to LAN
  • WAN to WAN

Depending on how they're connected, it's expected that you wouldn't be able to reach one or the other.

We'll need to know how you connected them to each other to assist you.

1 Like

What is the intent of each router? Presumably one of them is a gateway to the internet. What is the other one for? Is it to act as a dumb AP?

2 Likes

it's LAN TO LAN

ye the first got access to the internet but the second honestly or nothing i just want to access to it from my main router that's all i don't want to use it like a mesh or access point i just want to access both of them

OK, then try:

192.168.1.1 / 192.168.1.2

I'm confused as to what this device is doing on your network if you say "honestly or nothing..." for its function.

There are lots of things that can be done with these devices, but if you're just plugging it in for no other reason than to plug it in, sure, go for it.

Follow @lleachii 's advice, but make sure that the second IP address (the one ending in .2) is unused on your network and is outside the DHCP range of your DHCP server (likely on the main router)... and don't forget to disable the DHCP server on your secondary device.

i tried a lot but every time i disable dhcp i can't access to the second router even directly and i need to reset it to make it work again

What is the IP address of your main router?

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
1 Like

this is from the main router

root@OpenWrt:~# cat /etc/config/network

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

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.2.2'
        option _orig_ifname 'eth0.1 wlan0'
        option _orig_bridge 'true'
        option ifname 'eth0.1'

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

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

config interface 'wwan'
        option proto 'dhcp'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option macaddr '64:16:f0:58:5b:96'
        option hwmode '11ng'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'TX-STBC'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'
        option disabled '0'
        option country 'MA'
        option txpower '20'

config wifi-iface
        option network 'wwan'
        option ssid 'wifi_2.4G_7F44'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'sta'
        option bssid '04:95:E6:DE:01:59'
        option key 'Midelt@21'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'wwan'
        option encryption 'psk-mixed'
        option key 'karim123'
        option network 'lan'

root@OpenWrt:~# cat /etc/config/dhcp
config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      0  # enable for dial on demand
        option localise_queries 1
        option rebind_protection 1  # disable if upstream must serve RFC1918 addresses
        option rebind_localhost 1  # enable for RBL checking and similar services
        #list rebind_domain example.lan  # whitelist RFC1918 responses for domains
        option local    '/lan/'
        option domain   'lan'
        option expandhosts      1
        option nonegcache       0
        option authoritative    1
        option readethers       1
        option leasefile        '/tmp/dhcp.leases'
        option resolvfile       '/tmp/resolv.conf.auto'
        #list server            '/mycompany.local/1.2.3.4'
        #option nonwildcard     1
        #list interface         br-lan
        #list notinterface      lo
        #list bogusnxdomain     '64.94.110.11'

config dhcp lan
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

config dhcp wan
        option interface        wan
        option ignore   1
root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

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-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fe80::/10'
        option src_port '547'
        option dest_ip 'fe80::/10'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

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'

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 include
        option path '/etc/firewall.user'

root@OpenWrt:~#
root@OpenWrt:~# clear
root@OpenWrt:~# ubus call system board
Command failed: Not found
root@OpenWrt:~# cat /etc/config/network

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

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.2.2'
        option _orig_ifname 'eth0.1 wlan0'
        option _orig_bridge 'true'
        option ifname 'eth0.1'

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

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

config interface 'wwan'
        option proto 'dhcp'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option macaddr '64:16:f0:58:5b:96'
        option hwmode '11ng'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'TX-STBC'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'
        option disabled '0'
        option country 'MA'
        option txpower '20'

config wifi-iface
        option network 'wwan'
        option ssid 'wifi_2.4G_7F44'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'sta'
        option bssid '04:95:E6:DE:01:59'
        option key 'Midelt@21'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'wwan'
        option encryption 'psk-mixed'
        option key '***********'
        option network 'lan'

root@OpenWrt:~# cat /etc/config/dhcp
config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      0  # enable for dial on demand
        option localise_queries 1
        option rebind_protection 1  # disable if upstream must serve RFC1918 addresses
        option rebind_localhost 1  # enable for RBL checking and similar services
        #list rebind_domain example.lan  # whitelist RFC1918 responses for domains
        option local    '/lan/'
        option domain   'lan'
        option expandhosts      1
        option nonegcache       0
        option authoritative    1
        option readethers       1
        option leasefile        '/tmp/dhcp.leases'
        option resolvfile       '/tmp/resolv.conf.auto'
        #list server            '/mycompany.local/1.2.3.4'
        #option nonwildcard     1
        #list interface         br-lan
        #list notinterface      lo
        #list bogusnxdomain     '64.94.110.11'

config dhcp lan
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

config dhcp wan
        option interface        wan
        option ignore   1
root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

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-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fe80::/10'
        option src_port '547'
        option dest_ip 'fe80::/10'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

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'

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 include
        option path '/etc/firewall.user'


You provided no information on the second router, which is rather important to assist you. Regarding router_2 we need to know:

  • Is the second router running OpenWrt?
  • If not, does it's OS allow you to alter things like:
    • Change LAN IP and subnet mask
    • Add a LAN gateway; or
    • Disable Masquerade on WAN's firewall

yes they're both running openwrt

This is strange... the command should provide the information about the device and OpenWrt version that it is running.

What version of OpenWrt is on this first (main) router? What is the device (brand+model)?

1 Like

So, in this case:

  • set the second device to 192..168.1.2/24
  • set DNS and gateway to 192.168.1.1

version : attitude adjustment
vodafone hg556a atheros

second router is running latest version of openwrt

ok I'll try it

Really??? Wow. That should immediately upgraded -- the device appears to support 22.03. Attitude Adjustment has been unsupported and EOL for approaching a decade and has a lot of security vulnerabilities -- it shoult not be used in any situation, especially as a border gateway.

Keep in mind, the DSL chipset won't work... I would imagine you are not using DSL on this device -- please confirm.

Please upgrade immediately.

1 Like

the attitude adjustment is the only version that works well on this devices I tested each one of them and also the lede 17 reboot seems to some but in the latest versions of openwrt I barely get 1mbps instead of the full the debit of 32mbps i get in attitude adjustment
and about security i don't care
and yes I'm not using DSL I'm using it wirelessly

so it's working thanks guys i was missing the gateway option

1 Like

You say that now. But when your network or systems get compromised, you'll probably feel differently. Don't underestimate how much damage someone can do by simply getting your email credentials or a banking password. If nothing else, it can just be a major headache.

If you couldn't get reasonable performance on newer versions of OpenWrt, please consider upgrading your hardware that is capable of running the latest (OpenWrt or otherwise).

1 Like