OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • [Resolved] WAN Gateway different subnet - Persistent
« previous next »
  • Print
Pages: [1]

Author Topic: [Resolved] WAN Gateway different subnet - Persistent  (Read 5163 times)

michaelsage

  • Newbie
  • *
  • Posts: 12
  • Karma: 2
    • View Profile
[Resolved] WAN Gateway different subnet - Persistent
« on: February 02, 2018, 11:38:57 pm »
Hi All,

I run a dedicated server. I have a slight issue in that my WAN gateway is not on the same subnet as my public IPs.

I used shellcmd in pfSense and understand that doesn't exist in OPNSense which is fine.

Can I simple add the following to my /etc/rc file? Is it persistent (i.e. upgrades & updates)?

Code: [Select]
route add -net GWIP -iface em0
route add default GWIP

Is there somewhere I should put it instead?

Thanks

Michael
« Last Edit: February 03, 2018, 01:56:16 pm by michaelsage »
Logged

marjohn56

  • Hero Member
  • *****
  • Posts: 1676
  • Karma: 170
    • View Profile
Re: WAN Gateway different subnet - Persistent
« Reply #1 on: February 02, 2018, 11:57:59 pm »
If you enable secure shell and login to that as root you can do it from the shell, but doubt it would survive an update. You could also do it this way...

https://docs.opnsense.org/development/backend/autorun.html

I think you should also be able to do it by adding a route & gateway and setting it default, but don't quote me on that.
« Last Edit: February 03, 2018, 12:03:10 am by marjohn56 »
Logged
OPNsense 21.7 - Qotom Q355G4 - ISP - Community Fibre 1Gbps.

Team Rebellion Member - If we've helped you remember to applaud

mimugmail

  • Hero Member
  • *****
  • Posts: 6332
  • Karma: 435
    • View Profile
Re: WAN Gateway different subnet - Persistent
« Reply #2 on: February 03, 2018, 06:17:57 am »
Quote from: michaelsage on February 02, 2018, 11:38:57 pm
Hi All,

I run a dedicated server. I have a slight issue in that my WAN gateway is not on the same subnet as my public IPs.

I used shellcmd in pfSense and understand that doesn't exist in OPNSense which is fine.

Can I simple add the following to my /etc/rc file? Is it persistent (i.e. upgrades & updates)?

Code: [Select]

route add -net GWIP -iface em0
route add default GWIP

Is there somewhere I should put it instead?

Thanks

Michael


Just setup a gateway as usual and tick "Far Gateway", then the check for the same subnet is disabled :)
Happy routing!  8)
« Last Edit: February 03, 2018, 04:14:10 pm by mimugmail »
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

michaelsage

  • Newbie
  • *
  • Posts: 12
  • Karma: 2
    • View Profile
Re: WAN Gateway different subnet - Persistent
« Reply #3 on: February 03, 2018, 10:02:41 am »
Awesome. I'll give that a shot.

Thanks
Logged

michaelsage

  • Newbie
  • *
  • Posts: 12
  • Karma: 2
    • View Profile
Re: WAN Gateway different subnet - Persistent
« Reply #4 on: February 03, 2018, 01:55:55 pm »
Thanks that fixed it!
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13936
  • Karma: 1208
    • View Profile
Re: [Resolved] WAN Gateway different subnet - Persistent
« Reply #5 on: February 03, 2018, 03:37:46 pm »
I was under the impression pfSense had a similar checkbox of a different name for a while now too, possibly predating our option. :)


Cheers,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • [Resolved] WAN Gateway different subnet - Persistent
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2