Help With split tunneling and multiple subnets behind asa
Hello All,
our vpn clients can no longer access internet while connected to vpn.
I was hoping I could get an answer on here for an issue we are having. let me explain this with as little words as possible.
here was old network layout:
ASA
192.168.1.1 ----> the rest of the internal subnet (was only subnet in network)
now
ASA 3560
192.168.254.1/24 ----->192.168.254.2/24-->192.168.1.1/24
192.168.2.1/24
so what we did was route from 3560 to asa so we would be able to have multiple subnets since our asa has base license.
Our vpn with easy connect worked with our split tunneling before and now we made the change above and it no longer works. Can someone help me out as to why it no longer works and what changed need to be made to make it work.
Thank you.
ciscoasa# sh run
: Saved
ASA Version 8.2(2)
hostname ciscoasa
enable password 1N7bTm05RXLnBcUc encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
interface Vlan1
nameif inside
security-level 100
ip address 192.168.254.1 255.255.255.0
interface Vlan2
nameif outside
security-level 0
ip address x.x.x.x 255.255.255.248
interface Ethernet0/0
switchport access vlan 2
ftp mode passive
clock timezone est -5
same-security-traffic permit intra-interface
access-list NoNat extended permit ip any 172.16.5.0 255.255.255.0
access-list SplitTunnel standard permit 192.168.1.0 255.255.255.0
access-list SplitTunnel standard permit 192.168.2.0 255.255.255.0
access-list SplitTunnel standard permit 192.168.254.0 255.255.255.0
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
ip local pool VPNPool 172.16.5.1-172.16.5.254 mask 255.255.255.0
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list NoNat
nat (inside) 1 0.0.0.0 0.0.0.0
route outside 0.0.0.0 0.0.0.0 x.x.x.x 1
route inside 192.168.1.0 255.255.255.0 192.168.254.2 1
route inside 192.168.2.0 255.255.255.0 192.168.254.2 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set TransformSet1 esp-3des esp-md5-hmac
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto dynamic-map DynamicMap1 1 set transform-set TransformSet1
crypto map MainMap 999 ipsec-isakmp dynamic DynamicMap1
crypto map MainMap interface outside
crypto isakmp enable outside
crypto isakmp policy 10
authentication pre-share
encryption 3des
hash sha
group 2
lifetime 86400
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 5
ssh timeout 5
console timeout 0
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
ntp server 64.90.182.55 source outside
webvpn
enable outside
svc image disk0:/anyconnect-dart-win-2.5.0217-k9.pkg 1
svc enable
tunnel-group-list enable
group-policy RenotreUsers internal
group-policy RemoteUsers internal
group-policy RemoteUsers attributes
vpn-tunnel-protocol svc webvpn
split-tunnel-policy tunnelspecified
split-tunnel-network-list value SplitTunnel
tunnel-group RemoteUsers type remote-access
tunnel-group RemoteUsers general-attributes
address-pool VPNPool
default-group-policy RemoteUsers
tunnel-group RemoteUsers webvpn-attributes
group-alias Southeast-Security-VPN enable
tunnel-group RemoteUsers ipsec-attributes
pre-shared-key *****
I think it could be your NAT statement. You should try an avoid using any unless you tunnel everything. Try making this change
no access-list NoNat extended permit ip any 172.16.5.0 255.255.255.0
object-group network INTERNAL_NETWORKS
description Internal Networks
network-object 192.168.1.0 255.255.255.0
network-object 192.168.2.0 255.255.255.0
network-object 192.168.254.0 255.255.255.0
access-list NoNat extended permit ip object-group INTERNAL_NETWORKS 172.16.5.0 255.255.255.0
You may have to re-add your NAT0
nat (inside) 0 access-list NoNat
Similar Messages
-
Help with Contacts - IDs and Multiple Accounts
Hello
I am involved in the process of migrating accounts and contacts into ByDesign, but have come across a couple of questions that I can't seem to find an answer to anywhere!
Firstly, is it possible to specify the 'Contact ID' reference range. I have found how to set the Account ID for suppliers and customers, and also how to set the Employee ID for employees within Fine Tuning, but cannot seem to find the same feature for the Contact ID. Is it possible to set this field up to have a certain amount of digits, and between certain values when automated?
My other question regards having contacts linked to more than one account. I understand it is possible to have a contact linked to multiple accounts, but how? Is it possible from the Migration Templates? Is it a simple case of using the same Contact ID and information, but differing Account IDs on the 'Contacts' tab of the Template?
Any help is much appreciated.
Thanks
AndrewYou should not be using some other user's icloud account on your devices. That's not how icloud is designed, because if you edit/delete data on the device that ties to the other user's icloud account, then those changes will automatically sync to their devices - something I don't think you two want happenning.
If you want to keep your work data separate from personal data, then depending on what databases you want to use, like contacts or calendars, you could use a single icloud account and define groups in contacts, for exampe, some for work and some for personal. Same thing with calendars, define different calenders for each environment. Some databases like email may be problematic, however, I would think that work emails involve a non-icloud email account, so you could use the icloud email for personal use.
The other approach is to define and use two icloud accounts and for each device, decide which account to use. Having one device that uses both work and personal data would be a problem. -
I have a "Contact" organization issue I need help with. I organize multiple customers under their account affiliation. I place the people with their contact info under each account name by their dept/role in the notes section of their account. I am looking to be able to directly dial / email from this info in yet notes section located within a contact. On Blackberry, the notes area entered in a contact can connect directly but on the iPhone those numbers/emails are inactive. I am trying to avoid having to create each of these individuals as a separate contact and keep them under their account affiliation. It is easier to find them. This does not seem like that complicated of a request and hoping someone can tell me how or share an app that will enable the "notes" within a contact be "active". Hope this makes sense.
I seem to recall that this question has been asked before and I'm pretty sure that the answer is that you can't do what you want to do with the native contact app. However, there are lots of contact apps out there that pull from the built app's data but have other features. Perhaps one of them would meet your needs.
-
Need help with Blog, Wiki and Gallery
Hi Team,
Need help with Blog, Wiki and Gallery startup. I have newly started visiting forums and quite interested to contribute towards these areas also.
Please help.
Thanks,
Santosh Singh
Santosh SinghHello Santhosh,
Blog is for Microsoft employees only. However, you can contribute towards WIKI and GALLERY using the below links.
http://social.technet.microsoft.com/wiki/
http://gallery.technet.microsoft.com/ -
What's the phone number I should call for help with my iPhone and ihome dock?
What's the phone number I should call for help with my iPhone and ihome dock?
http://www.ihomeaudio.com/support/
-
Integrtion Scenario using BPM with two sender and multiple receiver
integrtion Scenario using BPM with two sender and multiple receiver
How many Application Components are required?Hi Vinod,
1) In integration repository you can have one or many software components it depends on your landscape orchestration
2) In integration direcory you need at least one service for bpm and one or many for each system in your bpm
also each connection between systems and bpm must have receiver determination and so on.
Advice: Please treat BPM as a separate system.
best,
Wojciech -
Help with photoshop quitting and AMD graphics
help with photoshop quitting and AMD graphics
im not a techy, but it appears i have to do someting with my amd graphics card - this might be why my software is crashing - ive no idea what to do thoughHi Chris
I have tried to go on the website, then i tried to download the automatic detect because i wasnt sure which driver i had or needed - but it has just downloaded a load of game software - which i dont want ( i dont think)
i have find out my laptop has a amd radeon HD 8750M card, but i dont know what im doing! i would hate to mess my computer up as i am in thailand with no one to help me!
its frustrating as i am paying for CC but cant use it! -
LOV with auto suggest and multiple check boxes
Is it possible to implement LOV with auto suggest and multiple check boxes using ADF faces components?. Any alternative implementation/pointers are appreciated.
Regards,
SuryaHi,
build it yourself as a task flow opened in a popup. see: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/69-custom-lov-with-btf-276178.pdf
Frank -
FlexVPN with F-VRF and multiple tunnels
Hi There,
I have a burning question and initially need to understand the possibility of the following scenario, below is a diagram of a single point-to-point connection used for proof of concept. The Hub router acts as a local RADIUS and is to issue IP addresses for both the client tunnel interfaces.
Two separate tunnels are required, one between Virtual-template 1 and tunnel 1 and one between Virtual-template 2 and tunnel 2, hence they are within a separate VRF on both routers.
Basically I am wondering if this is possible as getting this to work is a struggle.. I am currently using PSK authentication, though also wondering if there would be issues using certificates, i.e. the hub would effectively receive two separate SAs with the same certificate.
The flex client and hub have separate profiles keyrings etc for each connection...
Has anyone got this working before??
Any help or suggestions/pitfalls would be appreciated.Hi Olpeleri,
Many thx for the reply,
I have tried using two interfaces on the Hub, though no joy so far..... I want to have the hub tunnel end points in different VRFs, hence I have tried with two virtual templates A and B and interfaces A and B in different VRFs to each other.
i.e, looking at just one tunnel to start with,
HUB
interface Virtual-Template1 type tunnel
ip vrf forwarding VRF_A
ip unnumbered Loopback20
tunnel source Ethernet0/0
tunnel mode ipsec ipv4
tunnel protection ipsec profile IPSEC-PROFILE
end
interface e0/0
ip vrf forwarding VRF_A
ip address 172.16.0.2 255.255.255.0
Is this config correct, I have tried using a front door VRF for each interface also, though the tunnel fails to build when both interfaces are there
The profile looks like this repeated for each interface with different names and virtual template etc..
crypto ikev2 profile default
match fvrf any
match identity remote fqdn domain cisco.com
identity local fqdn Hub1.cisco.com
authentication remote pre-share
authentication local pre-share
keyring ALL
pki trustpoint cisco
dpd 10 2 periodic
aaa authorization group psk AUTHOR_LIST AUTHOR_POL
virtual-template 1
Thanks, -
Cisco AnyConnect SSL VPN no split tunnel and no hairpinning internet access
Greetings,
I am looking to configure a Cisco ASA 5515X for Cisco AnyConnect Essentials SSL VPN where ALL SSL-VPN traffic is tunneled, no split tunneling or hairpinning on the outside interface. However users require internet access. I need to route traffic out the "trusted" or "inside" interface to another device that performs content-filtering and inspection which then egresses out to the internet from there. Typically this could be done using a route-map (which ASA's do not support) or with a VRF (again, not an option on the ASA). The default route points to the outside interface toward the internet.
Is there no other method to force all my SSL-VPN traffic out the inside interface toward LAN subnets as needed and have another default route point toward the filtering device?
OR
Am I forced to put the ASA behind the filtering device somehow?Hi Jim,
You can use tunnel default route for vpn traffic:
ASA(config)# route inside 0.0.0.0 0.0.0.0 <inside hop> tunneled
configure mode commands/options:
<1-255> Distance metric for this route, default is 1
track Install route depending on tracked item
tunneled Enable the default tunnel gateway option, metric is set to 255
This route is applicable for only vpn traffic.
HTH,
Shetty -
ISA550 and multiple subnets?
Just picked up a ISA550 and have been playing around with it a bit but seem to be having some trouble. I have two LAN subnets in my small business with approx 10 hosts per subnet. I'd like to use the ISA550 to route between them (and to the internet) but can't seem to figure out how. Is it just as simple as creating two VLANS? Can the ISA550 route VLAN traffic?
With my old RV042G, I had the option to setup multiple subnets inside the setup menu but I don't see any such area with the 550. Any help would be appreciated!Each port is configurable. So you just need to create a VLAN name and IP/Subnet for each port.
For example, if you only have two subnets then you would do this:
Port 1 IP address/network mask - 192.168.1.0/24
VLAN name for Port 1 - office_network
Port 2 IP address/network mask - 192.168.2.0/24
VLAN name for Port 2 - server_network -
I'm Starting in Java programing and need some help.
Based in the information of txt file, I need to split a file.txt into "n" .txt files, depending of the blocks thats the file containt. It's delimited by """".
And put the name between "UZ0RN0" the second field
Example:
"01APR02","UZ0RN0","******************************************
EMHA PNR.UZ0RN0 CR01APR 0419Z MEX BY GS BT
MEX GS BT 01APR 0421Z 385310 MX
"01APR02","TSCS44","******************************************
etc.
My question is how do I split a file into parts eg split test.txt into UZ0RN0.txt, TSCS44.txt, etc.
Pls help. Where do I start? I just need help with the the manage of the java.nio.channels.FileChannel to generate several files
Thanks a lot.Ok Thats is the final code:
This program divide a file.txt in "n" files.txt's according of the block's that the file.txt contain and catch the name of the second tokent to name the new file.txt
import java.io.*;
import java.nio.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class FileCopy {
public static void main(String[] args) {
if(args.length==0) {
System.out.println("No existe archivo a copiar. Application usage is: \n" +
"java -classpath. Filecopy \" filepath\"" );
System.exit(1);
File fromFile = new File(args[0]);
if(!fromFile.exists()) {
System.out.println("Archivo a copiar. " + fromFile.getAbsolutePath()
+ ", no existe.");
System.exit(1);
FileInputStream inFile = null;
try{
inFile = new FileInputStream(fromFile);
} catch(FileNotFoundException e) {
e.printStackTrace(System.err);
//assert false;
FileChannel inChannel = inFile.getChannel();
try{
int SizeFile = (int)inChannel.size();
ByteBuffer buf = ByteBuffer.allocate(SizeFile);
int length = 0;
int lengthArch = 0;
int NoArch = 0;
int NoComilla = 0;
String str = new String("");
try{
while ((length = inChannel.read(buf)) != -1 ) {
buf.rewind();
for (int i=0; i<length; i++) {
lengthArch++;
byte b = buf.get();
//Delimita caracter. Cada bloque tiene 6 "'s
if ( b == 34 ) {
NoArch++;
NoComilla++;
//Definir nombre del archivo
if (NoComilla==3) {
if ( b!=34) {
str += (char)b;
//Imprime archivo
if (NoComilla==6) {
fromFile = fromFile.getAbsoluteFile(); //Asegura una ruta absoluta
File parentDir = new File(fromFile.getParent()); //Obtiene el directorio
File bFile = new File(parentDir,str + ".txt"); //Genera nuevo archivo
str = ("");
File toFile1 = createFile(bFile);
FileOutputStream outFile1 = null;
try{
outFile1 = new FileOutputStream(toFile1);
} catch(FileNotFoundException e) {
e.printStackTrace(System.err);
//assert false;
FileChannel outChannel1 = outFile1.getChannel();
// Write the files
try {
inChannel.transferTo(((i + 1) - lengthArch),lengthArch,outChannel1);
outFile1.close(); // Close the output stream & the channel
System.out.println("Archivo " + (NoArch/6) +": " + ((i +1) - lengthArch) + " long " + lengthArch);
} catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
lengthArch = 0;
NoComilla = 0;
//System.out.print((char)b);
buf.clear();
System.out.println("Tamano del archivo de Origen " + SizeFile);
System.out.println("EOF " + (NoArch/6) + " Archivos copiados.");
catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
inFile.close();
} catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
System.exit(0);
// Metodo para crear un achivo y en caso de que exista hacer *+_backup.*
public static File createFile(File aFile) {
aFile = aFile.getAbsoluteFile(); //Asegura una ruta absoluta
File parentDir = new File(aFile.getParent()); //Obtiene el directorio
String name = aFile.getName(); //Obtiene el nombre del archivo
int period = name.indexOf('.'); //Busca el separador de la extension
if(period == -1) //Si no es
period = name.length(); //Lo coloca al final del String
String nameAdd = "_backup"; //Agrega "Backup" al nombre
//Crea el objeto archivo que es unico
File backup = new File(name.substring(0,period)
+ name.substring(period));
while (backup.exists()) { //Si el nombre ya existe....
name = backup.getName(); //Obtiene el nombre actual del archivo
period += nameAdd.length(); //Agrega el separador
backup = new File(parentDir, name.substring(0,period) //agrega backup de nuevo
+ nameAdd + name.substring(period));
return backup;
This is the example of the file with 2 blocks
"01APR02","UZ0RN0","******************************************
EMHA PNR.UZ0RN0 CR01APR 0419Z MEX BY GS BT
385310 MX
***1.ALCANTARA/JORGEALBERTO
FONE-MEX/N000
RCVD-PAX
TKT -T/OK
1 MX 7M 01APR MEXMTY HK 1 650A 815A
AB * FLT 7 7A
RCVD-PAX
MEX GS BT 01APR 0419Z 385310 MX
AB | FLT 7 7A
RCVD-PAX
MEX GS BT 01APR 0421Z 385310 MX
"01APR02","TSCS44","******************************************
.... PNR.TSCS44 CR25MAR 1834Z HDQ BY RM 1S
***1.1BRAVO/OCTAVIO
FONE-MTY1-81503300*A/A528
RLOC-HDQ1SJOXMWV/D4C2/86511574/MTY/1S/T/MX
/MXN
G FX-OSI YY 86511574 / VILLATOURS CENTRO P
CC D4C2
OSI MX TKNA 13235822315830
SSRSEATMXHS1MTYMEX0070K28MAR.16B
SSRSEATMXHS1MEXMTY0007K01APR.09B
1 MX 70K 28MAR MTYMEX HK 1 645A 815A
2 MX 7K 01APR MEXMTY HK 1 650A 815A
X3 SSRSEATMXNN1MTYMEX0070K28MAR.16B
RCVD-
HDQ RM 1S 25MAR 2205Z
X3 SSRSEATMXNN1MEXMTY0007K01APR.09B
RCVD-
HDQ RM 1S 25MAR 2231Z
X3 SSRSEATMXKK1MTYMEX0070K28MAR.16BN
X3 SSRSEATMXKK1MEXMTY0007K01APR.09BN
RCHDQ1SJOXMWV/D4C2/86511574/MTY/1S/T/MX
/MXN
HDQ RM 1S 26MAR 0055Z
Chao/Bye -
Can someone help with splitting a Linked List.??
Any help would be awesome!!!
My code just will not work!! Any help would be appreciated! My problem is in the last method SplitAt. These are the conditions set and my code:
Splitting a Linked List at a Given Node, into Two Sublists
a. Add the following as an abstract method to the class
LinkedListClass:
public void splitAt (LinkedListClass<T> secondList, T item);
//This method splits the list at the node with the info item into two sublists.
//Precondition: The list must exist.
//Postcondition: first and last point to the first and last nodes of the first sublist,
// respectively. secondList.first and secondList.last point to the first
// and last nodes of the second sublist.
Consider the following statements:
UnorderedLinkedList<Integer> myList;
UnorderedLinkedList<Integer> otherList;
Suppose myList points to the list with the elements 34, 65, 18, 39, 27, 89, and 12 (in this order). The statement
myList.splitAt(otherList, 18);
splits myList into two sublists: myList points to the list with elements 34 and 65, and otherList points to the sublist with elements 18, 39, 27, 89, and 12.
b. Provide the definition of the method splitAt in the class UnorderedLinkedList. Also write a program to test your method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(secondList))
found= true;
else
trailCurrent=current;
i++;
if(found)
if(first==current)
first=first;
last=last;
count=count;
count=0;
else
first=current;
last=last;
last=null;
count = count- i+1;
count = i-1;
else
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
}Edited by: romeAbides on Oct 10, 2008 1:24 PMI dont have a test program at all. The program is supposed to prompt for user input of numbers. (it does) Take the input and end at input of -999 (it does). Then it asks user where it wants to split list (it does). When I enter a number it does nothing after that. I am going to post updated code and see if that helps along with all the classes. Thanks!
This is the class to prompt:
import java.util.*;
public class Ch16_ProgEx6
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
UnorderedLinkedList<Integer> list
= new UnorderedLinkedList<Integer>();
UnorderedLinkedList<Integer> subList =
new UnorderedLinkedList<Integer>();
Integer num;
System.out.println("Enter integers ending with -999.");
num = console.nextInt();
while (num != -999)
list.insertLast(num);
num = console.nextInt();
System.out.println();
System.out.println("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("Enter the number at which to split list: ");
num = console.nextInt();
list.splitAt(subList, num);
System.out.println("Lists after splitting list");
System.out.print("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("sublist: ");
subList.print();
System.out.println();
System.out.println("Length of sublist: " + subList.length());
}This is the ADT:
public interface LinkedListADT<T> extends Cloneable
public Object clone();
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public boolean isEmptyList();
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public void initializeList();
//Method to initialize the list to an empty state.
//Postcondition: The list is initialized to an empty
// state.
public void print();
//Method to output the data contained in each node.
public int length();
//Method to return the number of nodes in the list.
//Postcondition: The number of nodes in the list is
// returned.
public T front();
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T back();
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public boolean search(T searchItem);
//Method to determine whether searchItem is in the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public void insertFirst(T newItem);
//Method to insert newItem in the list.
//Postcondition: newItem is inserted at the
// beginning of the list.
public void insertLast(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: newItem is inserted at the end
// of the list.
public void deleteNode(T deleteItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list.
public void splitAt(LinkedListClass<T> secondList, T item);
}This is the linked list class:
import java.util.NoSuchElementException;
public abstract class LinkedListClass<T> implements LinkedListADT<T>
protected class LinkedListNode<T> implements Cloneable
public T info;
public LinkedListNode<T> link;
//Default constructor
//Postcondition: info = null; link = null;
public LinkedListNode()
info = null;
link = null;
//Constructor with parameters
//This method sets info pointing to the object to
//which elem points to and link is set to point to
//the object to which ptr points to.
//Postcondition: info = elem; link = ptr;
public LinkedListNode(T elem, LinkedListNode<T> ptr)
info = elem;
link = ptr;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//the node. The objects that the nodes point to
//are not cloned.
public Object clone()
LinkedListNode<T> copy = null;
try
copy = (LinkedListNode<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
return copy;
//Method to return the info as a string.
//Postcondition: info as a String object is
// returned.
public String toString()
return info.toString();
} //end class LinkedListNode
public class LinkedListIterator<T>
protected LinkedListNode<T> current; //variable to
//point to the
//current node in
//list
protected LinkedListNode<T> previous; //variable to
//point to the
//node before the
//current node
//Default constructor
//Sets current to point to the first node in the
//list and sets previous to null.
//Postcondition: current = first; previous = null;
public LinkedListIterator()
current = (LinkedListNode<T>) first;
previous = null;
//Method to reset the iterator to the first node
//in the list.
//Postcondition: current = first; previous = null;
public void reset()
current = (LinkedListNode<T>) first;
previous = null;
//Method to return a reference of the info of the
//current node in the list and to advance iterator
//to the next node.
//Postcondition: previous = current;
// current = current.link;
// A refrence of the current node
// is returned.
public T next()
if (!hasNext())
throw new NoSuchElementException();
LinkedListNode<T> temp = current;
previous = current;
current = current.link;
return temp.info;
//Method to determine whether there is a next
//element in the list.
//Postcondition: Returns true if there is a next
// node in the list; otherwise
// returns false.
public boolean hasNext()
return (current != null);
//Method to remove the node currently pointed to
//by the iterator.
//Postcondition: If iterator is not null, then the
// node that the iterator points to
// is removed. Otherwise the method
// throws NoSuchElementException.
public void remove()
if (current == null)
throw new NoSuchElementException();
if (current == first)
first = first.link;
current = (LinkedListNode<T>) first;
previous = null;
if (first == null)
last = null;
else
previous.link = current.link;
if (current == last)
last = first;
while (last.link != null)
last = last.link;
current = current.link;
count--;
//Method to return the info as a string.
//Postcondition: info as a String object is returned.
public String toString()
return current.info.toString();
} //end class LinkedListIterator
//Instance variables of the class LinkedListClass
protected LinkedListNode<T> first; //variable to store the
//address of the first
//node of the list
protected LinkedListNode<T> last; //variable to store the
//address of the last
//node of the list
protected int count; //variable to store the number of
//nodes in the list
//Default constructor
//Initializes the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public LinkedListClass()
first = null;
last = null;
count = 0;
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public boolean isEmptyList()
return (first == null);
//Method to initialize the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public void initializeList()
first = null;
last = null;
count = 0;
//Method to output the data contained in each node.
public void print()
LinkedListNode<T> current; //variable to traverse
//the list
current = first; //set current so that it points to
//the first node
while (current != null) //while more data to print
System.out.print(current.info + " ");
current = current.link;
}//end print
//Method to return the number of nodes in the list.
//Postcondition: The value of count is returned.
public int length()
return count;
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T front()
return first.info;
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public T back()
return last.info;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public Object clone()
LinkedListClass<T> copy = null;
try
copy = (LinkedListClass<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
//If the list is not empty clone each node of
//the list.
if (first != null)
//Clone the first node
copy.first = (LinkedListNode<T>) first.clone();
copy.last = copy.first;
LinkedListNode<T> current;
if (first != null)
current = first.link;
else
current = null;
//Clone the remaining nodes of the list
while (current != null)
copy.last.link =
(LinkedListNode<T>) current.clone();
copy.last = copy.last.link;
current = current.link;
return copy;
//Method to return an iterator of the list.
//Postcondition: An iterator is instantiated and
// returned.
public LinkedListIterator<T> iterator()
return new LinkedListIterator<T>();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public abstract boolean search(T searchItem);
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public abstract void insertFirst(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public abstract void insertLast(T newItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public abstract void deleteNode(T deleteItem);
public abstract void splitAt(LinkedListClass<T> secondList, T item);
}And this is the UnorderedLinked Class with the very last method the one being Im stuck on. The SplitAt Method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
count=0;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(item))
found= true;
else
trailCurrent=first;
current=first;
i++;
if(found)
if(first==current)
first.link=first;
last.link=last;
count--;
count=0;
else
first.link=current;
last.link=last;
last=null;
count = count- i+1;
count = i-1;
} else {
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
Any help or just advice would be fine. Im not the best at Java, better at VB. Am completely stumped! Thanks so much! -
RV320 with NAT source from multiple subnets
Hello,
I want to buy a router that will do NAT for multiple subnets, such as in the following configuration from Cisco IOS:
interface FastEthernet0/0
ip address 172.16.1.1/12
ip nat inside
interface FastEthernet0/1
ip address a.b.c.d/29
ip nat outside
ip nat pool dsl-pool a.b.c.e a.b.c.f prefix-length 29
ip nat inside source list 20 pool dsl-pool overload
access-list 20 permit 172.16.1.64 0.0.0.63
access-list 20 permit 172.16.21.0 0.0.0.255
It is possible on Cisco RV320 device?
Regars.
KrzysztofHi,
This should be no problem. It should work as you have thought.
I tested the configurations on my own ASA
object-group network REGIONAL-SOURCE
network-object 10.1.1.0 255.255.255.0
network-object 10.1.2.0 255.255.255.0
network-object 10.1.3.0 255.255.255.0
object-group network REGIONAL-NAT
network-object 10.1.201.0 255.255.255.0
network-object 10.1.202.0 255.255.255.0
network-object 10.1.203.0 255.255.255.0
nat (LAN,WAN) source static REGIONAL-SOURCE REGIONAL-NAT
Here at the results of the "packet-tracer" to show the translations
ASA(config)# packet-tracer input LAN tcp 10.1.1.100 12345 7.7.7.7 80
Phase: 4
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (LAN,WAN) source static REGIONAL-SOURCE REGIONAL-NAT
Additional Information:
Static translate 10.1.1.100/12345 to 10.1.201.100/12345
ASA(config)# packet-tracer input LAN tcp 10.1.2.100 12345 7.7.7.7 80
Phase: 4
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (LAN,WAN) source static REGIONAL-SOURCE REGIONAL-NAT
Additional Information:
Static translate 10.1.2.100/12345 to 10.1.202.100/12345
ASA(config)# packet-tracer input LAN tcp 10.1.3.100 12345 7.7.7.7 80
Phase: 4
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (LAN,WAN) source static REGIONAL-SOURCE REGIONAL-NAT
Additional Information:
Static translate 10.1.3.100/12345 to 10.1.203.100/12345
As you can see, everything is fine
Naturally take into consideration the fact that if you were to (for some reason) remove a "network-object" statement from some "object-group" then the operation of the "nat" would change even if you entered the removed "network-object" back. (unless you removed the last "network-object" inside the "object-group") This is because the order of the "network-object" inside the "object-group" would change. You would essentially have to recreate the "object-group" and "nat" configuration.
Hope this helps
Please do remember to mark a reply as the correct answer if it answered your question.
Feel free to ask more if needed
- Jouni -
Help with Time Evaluation and function exit (HRPTIM03 / SAPLHRLV_001)
Hello,
Hopefully someone can help me with an issue I am having with time evaluation and a user exit I wrote. The code for my exit is at the end of this post. IN DEV and QAS, everything works. However, in PRD, multiple rules are considered fulfilled (when looking in PT60), and so employees get two sets of vacation entitlements per month.
We have three rules for quota type 03 (vacation). Rules 3,6, and 9. Only rule 9 should apply to the individuals with the two job numbers in the code.
Any help would be greatly appreciated.
Shane
WHEN ABSENCE QUOTA TYPE IS 3 (VACATION)
CASE XT559L-QTYPE.
WHEN '3'.
CASE - COMPARE SELECTION RULE FOR ABSENCE QUOTA TYPES
CASE XT559L-ACCNR.
WHEN RULE SELECTED IS 009
WHEN '9'.
IF JOB NUMBER IS 5084 OR 3084, THEN THE RULE APPLIES
IF XP0001-STELL = '5084' OR XP0001-STELL = '3084'.
XSUBRC = '0'.
OTHERWISE, THE RULE DOES NOT APPLY
ELSE.
XSUBRC = '1'.
ENDIF.
WHEN ANY OTHER RULE IS SELECTED
WHEN OTHERS.
IF JOB NUMBER IS 5084 OR 3084, THEN THE RULE DOES NOT APPLY
IF XP0001-STELL = '5084' OR XP0001-STELL = '3084'.
XSUBRC = '1'.
OTHERWISE, THE RULE APPLIES NORMALLY
ELSE.
XSUBRC = '0'.
ENDIF.
ENDCASE.
WHEN OTHERS.
ENDCASE.The problem was that even though the code was transported to PRD, and listed as Active - it still was not activated, and had to manually be done though CMOD.
Maybe you are looking for
-
Field "Value field texts" is disabled to enter new values
Hi there, I'm trying to enter new values on the field "Value field texts" from Depreciation Area, in Config Asset Value Display(Financial Accounting (New) > Asset Accounting > Information System > Configure Asset Value Display). The fields are disble
-
Transfer files from old CRT iMac
My mom just got a new Intel iMac, and when she was setting it up, it told her she could transfer files from her old iMac using a firewire cable. Well, the old iMac doesn't have firewire. Does she have any other options? She's not very computer savvy,
-
T500 with Windows 7 64bit upgraded to ADATA SSD S599 (SandForce) BSOD after wake up
Hello I have just upgraded my T500 with the ADATA SSD S599 (SandForce based) and it gets real performance boost. Everything works fine except Sleep mode, specifically waking up: when I open the lid to recover from the sleep mode I got the Blue Scree
-
Uninstalling a windows partition; it comes back to life
When trying to uninstall a windows partition using boot camp, I'm told by the app I need "software update" first. It's not the system, as I'm running 10.6.3. So I download the latest boot camp version, 3.1 vs 3.0. It won't open, even double-clicking
-
IPhone 4S updated to iOS8, no internet possible at all
After updating my iPhone 4S to iOS 8.0.2 my iPhone seemed to work properly. Only a few thing where reacting slow. - Like response during typing, the typed words appeared after a few seconds or didn't appear at all. - Turning the iPhone from vertical