diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java
index 42290cb15..7c0518a92 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java
@@ -16,6 +16,7 @@ import java.util.Iterator;
import java.util.Set;
import net.i2p.time.Timestamper;
+import net.i2p.router.transport.udp.UDPTransport;
/**
* Handler to deal with form submissions from the main config form and act
@@ -29,6 +30,7 @@ public class ConfigNetHandler extends FormHandler {
private boolean _saveRequested;
private boolean _recheckReachabilityRequested;
private boolean _timeSyncEnabled;
+ private boolean _requireIntroductions;
private String _tcpPort;
private String _udpPort;
private String _inboundRate;
@@ -57,6 +59,7 @@ public class ConfigNetHandler extends FormHandler {
public void setSave(String moo) { _saveRequested = true; }
public void setEnabletimesync(String moo) { _timeSyncEnabled = true; }
public void setRecheckReachability(String moo) { _recheckReachabilityRequested = true; }
+ public void setRequireIntroductions(String moo) { _requireIntroductions = true; }
public void setHostname(String hostname) {
_hostname = (hostname != null ? hostname.trim() : null);
@@ -253,7 +256,14 @@ public class ConfigNetHandler extends FormHandler {
}
}
- if (_timeSyncEnabled) {
+ if (_requireIntroductions) {
+ _context.router().setConfigSetting(UDPTransport.PROP_FORCE_INTRODUCERS, "true");
+ addFormNotice("Requiring SSU introduers");
+ } else {
+ _context.router().removeConfigSetting(UDPTransport.PROP_FORCE_INTRODUCERS);
+ }
+
+ if (true || _timeSyncEnabled) {
// Time sync enable, means NOT disabled
_context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false");
} else {
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
index 12e01852a..12df19d01 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
@@ -2,6 +2,9 @@ package net.i2p.router.web;
import net.i2p.time.Timestamper;
import net.i2p.router.RouterContext;
+import net.i2p.router.CommSystemFacade;
+import net.i2p.data.RouterAddress;
+import net.i2p.router.transport.udp.UDPAddress;
public class ConfigNetHelper {
private RouterContext _context;
@@ -43,19 +46,12 @@ public class ConfigNetHelper {
return "" + port;
}
- public String getUdpPort() {
- int port = 8887;
- String val = _context.getProperty(PROP_I2NP_UDP_PORT);
- if (val == null)
- val = _context.getProperty(PROP_I2NP_INTERNAL_UDP_PORT);
- if (val != null) {
- try {
- port = Integer.parseInt(val);
- } catch (NumberFormatException nfe) {
- // ignore, use default from above
- }
- }
- return "" + port;
+ public String getUdpAddress() {
+ RouterAddress addr = _context.router().getRouterInfo().getTargetAddress("SSU");
+ if (addr == null)
+ return "unknown";
+ UDPAddress ua = new UDPAddress(addr);
+ return ua.toString();
}
public String getEnableTimeSyncChecked() {
@@ -66,6 +62,21 @@ public class ConfigNetHelper {
return " checked ";
}
+ public String getRequireIntroductionsChecked() {
+ short status = _context.commSystem().getReachabilityStatus();
+ switch (status) {
+ case CommSystemFacade.STATUS_OK:
+ return "";
+ case CommSystemFacade.STATUS_DIFFERENT:
+ case CommSystemFacade.STATUS_REJECT_UNSOLICITED:
+ return "checked=\"true\"";
+ case CommSystemFacade.STATUS_UNKNOWN:
+ return "";
+ default:
+ return "checked=\"true\"";
+ }
+ }
+
public static final String PROP_INBOUND_KBPS = "i2np.bandwidth.inboundKBytesPerSecond";
public static final String PROP_OUTBOUND_KBPS = "i2np.bandwidth.outboundKBytesPerSecond";
public static final String PROP_INBOUND_BURST = "i2np.bandwidth.inboundBurstKBytes";
diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp
index 5edc79c0c..11b98ca41 100644
--- a/apps/routerconsole/jsp/config.jsp
+++ b/apps/routerconsole/jsp/config.jsp
@@ -28,14 +28,12 @@
" />
- UDP port:
-
-You must poke a hole in your firewall or NAT (if applicable) to receive new inbound UDP packets on
-this port from arbitrary peers (this requirement will be removed in i2p 0.6.1, but is necessary now)
- TCP port: " />
- You must poke a hole in your firewall or NAT (if applicable) so that you can receive inbound TCP
- connections on it (this requirement will be removed in i2p 0.6.1, but is necessary now)
-
+ External UDP address:
+ Require SSU introductions through NAT hole punching?
+ />
+
If you can't poke a hole in your NAT or firewall to allow unsolicited UDP packets to reach the + router, as detected with the Status: ERR-Reject, then you will need SSU introductions. + Users behind symmetric NATs, such as OpenBSD's pf, are not currently supported.
- One advanced network option has to do with reseeding - you should never need to - reseed your router as long as you can find at least one other peer on the network. However, - when you do need to reseed, a link will show up on the left hand side which will - fetch all of the routerInfo-* files from http://dev.i2p.net/i2pdb/. That URL is just an - apache folder pointing at the netDb/ directory of a router - anyone can run one, and you can - configure your router to seed off an alternate URL by adding the java environmental property - "i2p.reseedURL=someURL" (e.g. java -Di2p.reseedURL=http://dev.i2p.net/i2pdb/ ...). You can - also do it manually by getting routerInfo-*.dat files from someone (a friend, someone on IRC, - whatever) and saving them to your netDb/ directory.
-- With the SSU transport, the internal UDP port may be different from the external - UDP port (in case of a firewall/NAT) - the UDP port field above specifies the - external one and assumes they are the same, but if you want to set the internal - port to something else, you can add "i2np.udp.internalPort=1234" to the - advanced config and restart the router. -