LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2008, 11:17 PM   #1
diggs
Member
 
Registered: Aug 2007
Distribution: whatever I'm told!
Posts: 31

Rep: Reputation: 15
How to set virtual IPs on startup (and a super bonus question!)


Good day!

These questions pertain to FC7.

I would like to set the following IPs on my computer whilst it starts up:
192.168.11.105
192.168.1.105
Currently I just type in
ifconfig eth2:0 192.168.11.105
ifconfig eht2:1 192.168.1.105

Also I cannot connect to the internets or the google with said server. I can SSH and RDP into it(with thinstuff) but that is it. I cannot ping yahoo or resolve any names but /etc/resolv.conf is hunky dory. The NIC for that interface is eth1.

Thanks!
 
Old 06-23-2008, 11:22 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Create /etc/sysconfig/network-scripts/ifcfg-eth2:0 with the relevant details in it (copy ifcfg-eth2 as a guide)

Have you checked your firewall settings (iptables -L)

Edit can you ping out to IP rather than name? You may need to let traffic out on port 53

Last edited by billymayday; 06-23-2008 at 11:24 PM.
 
Old 06-23-2008, 11:37 PM   #3
diggs
Member
 
Registered: Aug 2007
Distribution: whatever I'm told!
Posts: 31

Original Poster
Rep: Reputation: 15
Here's what I have in the ultra ghetto fire wall script for DNS

#this is to allow DNS to work.
iptables -A OUTPUT -p udp -o eth0 --dport 53 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 53 --dport 1024:65535 -j ACCEPT

Eth0 connects me to the outside.

Oh, is there a way to let me ping the internal network, 192.168.x.x whilst preventing pinging from the outside? Internal is on eth2 external is on eth0. Here is what I have for the pinging:

#iptables -A OUTPUT -m state -p icmp --state INVALID -j DROP
#iptables -A INPUT -p icmp -m icmp --icmp-type echo-request -j REJECT
#iptables -A OUTPUT -p icmp -m icmp --icmp-type echo-reply -j REJECT
#iptables -A INPUT -p icmp -j REJECT
#iptables -A OUTPUT -p icmp -j REJECT
 
Old 06-23-2008, 11:50 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Oh, is there a way to let me ping the internal network, 192.168.x.x whilst preventing pinging from the outside?
Yes, but your rules are for both

Can you connect to you DNS with telnet (telnet DNS_IP:53)

Can you post your /etc/resolv.conf please

Test DNS with dig in preference to ping as well
 
Old 06-24-2008, 12:03 AM   #5
diggs
Member
 
Registered: Aug 2007
Distribution: whatever I'm told!
Posts: 31

Original Poster
Rep: Reputation: 15
resolv.conf:
nameserver 204.174.64.1
nameserver 204.174.65.1

cannot telnet to either dns
no luck with dig either
 
Old 06-24-2008, 12:11 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'd try

Code:
iptables -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT
At least as a test
 
Old 06-24-2008, 12:19 AM   #7
diggs
Member
 
Registered: Aug 2007
Distribution: whatever I'm told!
Posts: 31

Original Poster
Rep: Reputation: 15
hmm, even after flushing iptables I still cannot resolve...

Oh, the virtual IP stuff worked, thanks!
 
Old 06-24-2008, 12:31 AM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
what does "route" give?
 
Old 06-24-2008, 12:39 AM   #9
diggs
Member
 
Registered: Aug 2007
Distribution: whatever I'm told!
Posts: 31

Original Poster
Rep: Reputation: 15
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
192.168.11.0 * 255.255.255.0 U 0 0 0 eth2
192.168.10.0 * 255.255.255.0 U 0 0 0 eth2
2xx.xx.1x9.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth2

default 192.168.10.1 0.0.0.0 UG 0 0 0 eth2
 
Old 06-24-2008, 02:10 AM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I won't claim to be a routing expert, but that doesn't look right to me. I'd assume the the second line should be eth2:0 for example, and your default gateway eth0. Did you set these routes?

Edit - does f7 have system-config-network on it?

Last edited by billymayday; 06-24-2008 at 02:14 AM.
 
Old 06-25-2008, 02:04 PM   #11
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi diggs,

have you enabled NAT for your eth0 network?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual IPs and Postfix SMTP msound Linux - Server 7 10-30-2008 02:22 AM
name based virtual hosting with two ips nephish Linux - Server 3 07-05-2007 07:29 AM
Adding virtual ips to fedora 3 linchat Linux - Networking 2 09-17-2005 07:31 PM
Strange crash on UT2003 startup (after v2225 patch and epic bonus pack installed) zaxomega Linux - Games 0 02-17-2004 05:49 AM
Simulating multiple virtual IPs. vsg123 Linux - Networking 2 07-17-2003 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration