OPNsense Forum

English Forums => General Discussion => Topic started by: iekozz on December 12, 2022, 02:12:20 PM

Title: Static route to ip not gateway
Post by: iekozz on December 12, 2022, 02:12:20 PM
Hi all,

For my isp here in the netherlands I need to make a route to ip route to ip route 0.0.0.0 0.0.0.0 145.54.xx.xx with a static ip on the wan side.

However, when I add a static route, it only allows me to send it via a gateway. and not send all traffic to that ip. I'm still abit new to opnsense. Here is the cisco config they provided.

---------------------------------------------------------
Dit is een voorbeeldconfig voor Cisco routers met IOS 12.x. en hoger waarbij GigabitEthernet1/0 is gekoppeld aan het interne netwerk en GigabitEthernet0/0 aan poort van de EVPN node van KPN. Aan deze config kunnen geen rechten worden ontleend.
---------------------------------------------------------

!
Interface GigabitEthernet1/0
description connection to internal network
ip address 31.149.xx.xx 255.255.255.248
no cdp enable
ip verify unicast reverse-path
no ip redirects
speed 1000
full-duplex
no shutdown
!
Interface GigabitEthernet0/0
description connection to KPN / CapID : CIN71206
ip address 145.54.xx.xx 255.255.255.252
no cdp enable
no ip directed-broadcast
speed 1000
full-duplex
no shutdown
!
no service finger
no service udp-small-servers
no service tcp-small-servers
no ip source-route
ip subnet-zero
ip classless
ip cef
ip name-server 194.151.228.18
ip name-server 194.151.228.34
!
ip route 0.0.0.0 0.0.0.0 145.54.xx.xx
!
Title: Re: Static route to ip not gateway
Post by: Patrick M. Hausen on December 12, 2022, 03:45:46 PM
Create a gateway with that IP address. Create default route to that gateway. It's just one more layer of abstraction enabling to give the gateway IP addresses meaningful names.
Title: Re: Static route to ip not gateway
Post by: iekozz on December 12, 2022, 04:27:26 PM
Quote from: pmhausen on December 12, 2022, 03:45:46 PM
Create a gateway with that IP address. Create default route to that gateway. It's just one more layer of abstraction enabling to give the gateway IP addresses meaningful names.
What should I enter at the network address? I've tried various variations of  0.0.0.0 0.0.0.0 but it won't let me save it. Always get a 'Specify a valid network matching the gateways ip protocol.' error.
Title: Re: Static route to ip not gateway
Post by: Patrick M. Hausen on December 12, 2022, 05:43:33 PM
0.0.0.0/0 or set that gateway as the upstream gateway in the WAN interface configuration. That means "default route".
Title: Re: Static route to ip not gateway
Post by: iekozz on December 16, 2022, 03:41:22 PM
I'm not sure what I am doing wrong but i'm still getting no internet from the static wan side.

Title: Re: Static route to ip not gateway
Post by: Patrick M. Hausen on December 16, 2022, 04:04:03 PM
Can you ping the gateway .229 from your OPNsense? If not you need to contact your ISP about the correct configuration.

HTH,
Patrick
Title: Re: Static route to ip not gateway
Post by: Demusman on December 16, 2022, 04:12:51 PM
Just to point out.... When you mask the first 2 octets in one post, then mask the last 2 octets in another, it's pretty easy to put them together.  ;)
Title: Re: Static route to ip not gateway
Post by: Patrick M. Hausen on December 16, 2022, 04:15:55 PM
Public IP addresses are not security relevant information. If they are, something is severely wrong.  ;)
Title: Re: Static route to ip not gateway
Post by: iekozz on December 16, 2022, 04:17:02 PM
Quote from: pmhausen on December 16, 2022, 04:04:03 PM
Can you ping the gateway .229 from your OPNsense? If not you need to contact your ISP about the correct configuration.

HTH,
Patrick
No, I cannot ping the .229 gateway
Quote from: Demusman on December 16, 2022, 04:12:51 PM
Just to point out.... When you mask the first 2 octets in one post, then mask the last 2 octets in another, it's pretty easy to put them together.  ;)
Yep, just realized that. Oh well.