Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

equivalent of cisco no ip classless command on Linux

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
inhibitor
n00b
n00b
Posts: 4
Joined: Tue Apr 08, 2014 1:44 pm

equivalent of cisco no ip classless command on Linux

  • Quote

Post by inhibitor » Tue Apr 08, 2014 2:09 pm

Hello guys ,

Can somebody tell me how can I get similar behavior as do following Cisco command on Linux ?

Code: Select all

# no ip classless
What according this link http://www.techexams.net/forums/ccna-cc ... sless.html do following

For example If I have next routing table

Code: Select all

# ip route list
172.28.60.0/22 dev eth0  proto kernel  scope link  src 172.28.61.222 
default via 172.28.60.1 dev eth0
If a packet comes in is destined for 172.28.64.100 then this packet is dropped . If packet is destined for 200.200.200.1, then this packet will be routed out the default route. Because the classfull portion 200.200.200 is not in the routing table.


If I do this, is it ok ?

Code: Select all

iptables -A OUTPUT -d 172.28.60.0/22 -j ACCEPT
iptables -A OUTPUT -d 172.28.0.0/16   -j DROP  


Which range of IPs should i drop to get same behavior ?
Or its possible to get same behavior using other tools than iptables etc. iproute2 ?

I have limited knowledge of routing an networking so any idea helps . Thank you ...
Top
Ralphred
l33t
l33t
Posts: 822
Joined: Tue Dec 31, 2013 11:52 am

  • Quote

Post by Ralphred » Thu Apr 10, 2014 11:26 am

All the iptables and routing behaviour I've seen in linux seems to work the same as a Cisco device with ip classless set, but it's not something I've ever considered too much.

Code: Select all

iptables -A OUTPUT -d 172.28.60.0/22 -j ACCEPT
iptables -A OUTPUT -d 172.28.0.0/16   -j DROP 
Dropping the whole class B after allowing your /22's worth of it through in iptables is acceptable, would stop it getting routed via the gateway and mimic no ip classless at the same time.

Putting a static route for the whole class B to a dead end, with a higher metric than the actual route to your /22's worth, could appear to mimic in the same way; but it's mimicing it by being a broken routing table, albeit by design, without actually dropping the packets, and that makes me feel... uncomfortable.
Top
AngelKnight
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Tue Jan 14, 2003 3:21 am

  • Quote

Post by AngelKnight » Sun Apr 13, 2014 5:25 pm

@inhibitor: Linux L3 forwarding is classless by default.
inhibitor wrote: For example If I have next routing table

Code: Select all

# ip route list
172.28.60.0/22 dev eth0  proto kernel  scope link  src 172.28.61.222 
default via 172.28.60.1 dev eth0
If a packet comes in is destined for 172.28.64.100 then this packet is dropped . If packet is destined for 200.200.200.1, then this packet will be routed out the default route. Because the classfull portion 200.200.200 is not in the routing table.
If you're asking if this will be the result, the answer is it will not: 172.28.64.100 will probably hit the default route and be forwarded to the listed destination.

If you're saying you're actually experiencing this behavior on a modern Linux box, then there's something unusual and more information will be needed in order to help you. Try attaching the output of "ip route show table all"
Top
inhibitor
n00b
n00b
Posts: 4
Joined: Tue Apr 08, 2014 1:44 pm

  • Quote

Post by inhibitor » Wed Apr 16, 2014 8:01 am

@AngelKnight

No I am not experiencing this behavior . But I would like . I would like to change default Linux behavior from ip classless to no ip classless .
And I was not sure how can I set it and if it's possible to do with iptables , iproute2 or any other tool .
Top
Post Reply

4 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic