bahos
January 26, 2024, 8:25pm
1
Hello, I am beginner on OpenWrt. I would like to connect my PC OpenWrt like home router to my fiber optic internet. I have my IP address from internet provider (IP,DNS,Gateway). I have two LAN ports. I need first one use like WAN and second one like LAN connected to my (8 port Gigabit Zyxel switch and Archer C20 like bridge just for wireless) for distributing Internet trough it. I am try it myself but unsuccessfully.
Thank you very much for help.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </>
" button:
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/dhcp
cat /etc/config/firewall
bahos
January 26, 2024, 8:45pm
3
root@OpenWrt:~# ubus call system board
{
"kernel": "5.15.137",
"hostname": "OpenWrt",
"system": "Intel(R) Celeron(R) J4125 CPU @ 2.00GHz",
"model": "ASRock J4125-ITX",
"board_name": "asrock-j4125-itx",
"rootfs_type": "ext4",
"release": {
"distribution": "OpenWrt",
"version": "23.05.2",
"revision": "r23630-842932a63d",
"target": "x86/64",
"description": "OpenWrt 23.05.2 r23630-842932a63d"
}
}
root@OpenWrt:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd9b:d2f7:4d92::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.111'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.0.1'
option dns '192.168.0.1'
root@OpenWrt:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
root@OpenWrt:~# cat /etc/config/firewall
config defaults
option syn_flood '1'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
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-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
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'
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 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'
bahos
January 26, 2024, 8:48pm
4
onfig interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.111'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.0.1'
option dns '192.168.0.1'
there was my ISP connection address
bahos
January 26, 2024, 8:50pm
5
when I am configured wireles in the OpenWrt PC there was internet connection but not in the LAN
This looks like an address behind another router (ISP provided, for example). This will not work for a direct connection to the internet.
We need to take a step back -- what is upstream of your new x86 router? Is it an ISP modem or modem+router combo unit? or something else? Please be specific.
bahos
January 26, 2024, 9:22pm
7
on the wall I have just plastic box, and there is input FiberOptic cable and output UTP cable with connector. When I am connecting any other router like tp-link on the end of this cable everything working well.
ok... it sounds like you have an ONT (optical network terminal) -- presumably it is purely a media converter (fiber to copper) and not doing any routing.
First, you need to fix your lan interface... remove the gateway and dns, and change the address to use the .1 address (this last thing isn't required, but it is customary)
It should look like this:
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.1'
option netmask '255.255.255.0'
option ip6assign '60'
Next, you need to create a wan interface. You said that you have 2 ports on your x86 router -- hopefully it will 'just work' like this:
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
Then reboot your router, plug the cable into your x86 machine's other port, and see if it works.
1 Like
bahos
January 26, 2024, 9:33pm
9
thank you very much! I am going to try it
bahos
January 26, 2024, 11:50pm
10
once again thank you very much! all working well
awesome!
If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks!
1 Like
i dont know how i didnt realize you could use 192.168.0.1, not sure why but somthing about it is pleasing lol
1 Like
system
Closed
February 6, 2024, 3:39am
13
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.