Class: Y2Network::Widgets::IP4Forwarding

Inherits:
CWM::CheckBox
  • Object
show all
Defined in:
src/lib/y2network/widgets/ip4_forwarding.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ IP4Forwarding

Returns a new instance of IP4Forwarding.


25
26
27
28
29
# File 'src/lib/y2network/widgets/ip4_forwarding.rb', line 25

def initialize(config)
  textdomain "network"

  @config = config
end

Instance Method Details

#helpObject


44
45
46
47
48
49
50
51
52
53
# File 'src/lib/y2network/widgets/ip4_forwarding.rb', line 44

def help
  _(
    "<p>Enable <b>IPv4 Forwarding</b> (forwarding packets from external networks\n" \
      "to the internal one) if this system is a router.\n" \
      "<b>Important:</b> if the firewall is enabled, allowing forwarding " \
      "alone is not enough. \n" \
      "You should enable masquerading and/or set at least one redirect rule in the\n" \
      "firewall configuration. Use the YaST firewall module.</p>\n"
  )
end

#initObject


31
32
33
34
# File 'src/lib/y2network/widgets/ip4_forwarding.rb', line 31

def init
  self.value = @config.routing.forward_ipv4
  disable if @config.backend?(:network_manager)
end

#labelObject


40
41
42
# File 'src/lib/y2network/widgets/ip4_forwarding.rb', line 40

def label
  _("Enable &IPv4 Forwarding")
end

#storeObject


36
37
38
# File 'src/lib/y2network/widgets/ip4_forwarding.rb', line 36

def store
  @config.routing.forward_ipv4 = value
end