SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm facing a problem with iptables. I'm new in network configuration in linux and I want to set up two networks. I have a LAN at home and at School and I want to be able to change my networks when I'm at school/home. I'm told that it can be done with iptables but I'm not quite sure if it's possible ?
I hope you understood me..
If somebody could give me some information about how it can be done and what am I supposed to know to do it. I want to do some reading ( I don't expect someone just tell me the commands )
P.S. I'm sorry for the wrong forum category... Could someone please move my topic to Networking ? Thanks in advance!
Best wishes,
tftd
Last edited by alpha_hack; 10-16-2007 at 03:25 AM.
Reason: Mistake in the example ifconfig
Actually I am not sure what you are actually trying to do.
Iptables is used mainly for security reason, or if you want to build a router/firewall out of a linux machine. It can be configured with a specific rule, to drop, alter or pass the properties (like IP address, port etc.) of certain IP Packets based on certain criteria from or out of your machine.
And these are done mainly for security reason, for example like NAT (Network Address Translation) feature in a firewall.
If you want to change your machine IP address based on the location where you at, then may be iptables is not what you are looking for. I would think that you probably should be looking into dhcp or someway to manipulate your rc.inet1 while it is booting up.
Anyway here is some links that I found good on iptables:
alpha hack
I'm trying to learn networking so when I looked at your example on eth1 I'm confused
as to it's output. You have a masked the last 8 bits of a number but it shows a broadcast of 192.168.1.255 and IP address of 192.168.0.123 so it would not be on the same network as I understand it.
Like I stated "I'm learning" so maybe I don't understand what your asking.
If you get your network address using DHCP protocol, then just rerun rc.inet1 each time. You can find it in /etc/rc.d
I've saw that. Fortunately my school has DHCP. So, I'm currently online, but I was wondering if it's possible to have another network which I could "ifconfig ethX up" when I need it?
Personally, I'd just serve dhcp in my home network too and be done with it. Problem solved.
Alternatively, you could create a short script to use ifconfig(8) and route(8) to manually configure your network. See /etc/rc.d/rc.inet1 for examples of how to use those two commands.
Hi, I do have the same problem before. But I was using RHEL that time, and I need to travel to different places, e.g. home, office, client side. And I feel tired to edit the network configuration file everytime. So I wrote my own shellscript to help me do this job. And then everytime when I am at a different place I just select the proper option from there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.