Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cisco asa: network mask issue #9

Open
mjardeli opened this issue Apr 25, 2017 · 3 comments
Open

cisco asa: network mask issue #9

mjardeli opened this issue Apr 25, 2017 · 3 comments

Comments

@mjardeli
Copy link

Hi Martin,

Sorry to send so much things over to you.
When a network is new loading an ACL, seems netmask is being incorrectly interpreted.
Try to process the following config line:
access-list FromInside extended deny ip 1.5.0.8 255.255.255.248 any4

result:
CiscoNet(name=N_1.5.0.8-3,ipAddr=1.5.0.8/0.0.0.7,desc=,alias=)
ACLRule(name=FromInside,src=N_1.5.0.8-3,dst=any,port=any,action=deny,pol=My_Policy,inst=My_Firewall,disabled=False,desc=)
Desc:
Src: CiscoNet(name=N_1.5.0.8-3,ipAddr=1.5.0.8/0.0.0.7,desc=,alias=)
Dst: CiscoAnyHost(name=any,ipAddr=None,desc=,alias=)
Port: CiscoAnyPort(name=any,port=0,desc=,alias=)
Verify: <ASAAclLine # 0 'access-list FromInside extended deny ip 1.5.0.8 255.255.255.248 any4'>

kind regards,

@martindube
Copy link
Contributor

martindube commented Apr 25, 2017 via email

@mjardeli
Copy link
Author

Worked!
I replaced:
def hostmask2netmask(self,hostmask):
mask_bytes = hostmask.split('.',3)
mask_bytes = [str(int(b) ^ 255) for b in mask_bytes]
return '.'.join(mask_bytes)
with:
def hostmask2netmask(self,hostmask):
return hostmask

now result is normal:
CiscoNet(name=N_1.5.0.8-29,ipAddr=1.5.0.8/255.255.255.248,desc=,alias=)
ACLRule(name=FromInside,src=N_1.5.0.8-29,dst=any,port=any,action=deny,pol=My_Policy,inst=My_Firewall,disabled=False,desc=)
Desc:
Src: CiscoNet(name=N_1.5.0.8-29,ipAddr=1.5.0.8/255.255.255.248,desc=,alias=)
Dst: CiscoAnyHost(name=any,ipAddr=None,desc=,alias=)
Port: CiscoAnyPort(name=any,port=0,desc=,alias=)
Verify: <ASAAclLine # 0 'access-list FromInside extended deny ip 1.5.0.8 255.255.255.248 any4'>

cheers,

@mjardeli
Copy link
Author

I tried to find when to use wildcard or netmask. All references to wildcard are old some of then more then 10 years. Maybe this was the old way to configure, need to research more.

My suggestion is to create another modifier and user can change it on command line at start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants